Fix various API 500 errors.

This commit is contained in:
James Cole
2025-01-26 06:30:38 +01:00
parent 6d89485792
commit c204533195
6 changed files with 39 additions and 20 deletions

View File

@@ -79,6 +79,11 @@ class UniqueAccountNumber implements ValidationRule
if (null === $this->expectedType) {
return;
}
if(is_array($value)) {
$fail('validation.generic_invalid')->translate();
return;
}
$value = (string) $value;
$maxCounts = $this->getMaxOccurrences();
foreach ($maxCounts as $type => $max) {

View File

@@ -94,6 +94,10 @@ class UniqueIban implements ValidationRule
if (0 === count($this->expectedTypes)) {
return true;
}
if(is_array($value)) {
return false;
}
$value = (string) $value;
$maxCounts = $this->getMaxOccurrences();
foreach ($maxCounts as $type => $max) {