From 7b73fdff5c1e473ebda39ea6a12526e12b9033b5 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Fri, 29 Mar 2013 03:22:19 +0400 Subject: [PATCH] Better validation rules validity check --- framework/base/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/base/Model.php b/framework/base/Model.php index 7818293..13e567d 100644 --- a/framework/base/Model.php +++ b/framework/base/Model.php @@ -329,7 +329,7 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess foreach ($this->rules() as $rule) { if ($rule instanceof Validator) { $validators->add($rule); - } elseif (isset($rule[0], $rule[1])) { // attributes, validator type + } elseif (is_array($rule) && isset($rule[0], $rule[1])) { // attributes, validator type $validator = Validator::createValidator($rule[1], $this, $rule[0], array_slice($rule, 2)); $validators->add($validator); } else {