mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Merge pull request #628 from tigrang/validation-translate
Ensure validation rule argument is a string before trying to translate.
This commit is contained in:
commit
9a693f9a13
1 changed files with 3 additions and 1 deletions
|
@ -3191,9 +3191,11 @@ class Model extends Object implements CakeEventListener {
|
||||||
}
|
}
|
||||||
if (!empty($args)) {
|
if (!empty($args)) {
|
||||||
foreach ($args as $k => $arg) {
|
foreach ($args as $k => $arg) {
|
||||||
|
if (is_string($arg)) {
|
||||||
$args[$k] = __d($validationDomain, $arg);
|
$args[$k] = __d($validationDomain, $arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$message = __d($validationDomain, $message, $args);
|
$message = __d($validationDomain, $message, $args);
|
||||||
} elseif (is_string($index)) {
|
} elseif (is_string($index)) {
|
||||||
if (is_array($validator['rule'])) {
|
if (is_array($validator['rule'])) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue