Merge pull request #628 from tigrang/validation-translate

Ensure validation rule argument is a string before trying to translate.
This commit is contained in:
ADmad 2012-04-27 06:47:09 -07:00
commit 9a693f9a13

View file

@ -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'])) {