mirror of
https://github.com/vlucas/valitron.git
synced 2025-12-30 23:01:52 +00:00
Fix 'Illegal offset type in isset or empty' warning when a param is an object.
Params can be any data type, but keys can only be integers or strings.
This commit is contained in:
parent
8f364b89a8
commit
f8f1c0061b
@ -992,7 +992,7 @@ class Validator
|
||||
$i = 1;
|
||||
foreach ($params as $k => $v) {
|
||||
$tag = '{field'. $i .'}';
|
||||
$label = isset($params[$k]) && !is_array($params[$k]) && isset($this->_labels[$params[$k]]) ? $this->_labels[$params[$k]] : $tag;
|
||||
$label = isset($params[$k]) && (is_numeric($params[$k]) || is_string($params[$k])) && isset($this->_labels[$params[$k]]) ? $this->_labels[$params[$k]] : $tag;
|
||||
$msg = str_replace($tag, $label, $msg);
|
||||
$i++;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user