From 760cf33ce377ae8e4f1548fb69891f078677ee53 Mon Sep 17 00:00:00 2001 From: euromark Date: Tue, 17 Jul 2012 10:47:20 +0200 Subject: [PATCH] make sure a missing validation rule always triggers a warning (in productive mode this will be logged in the log files) --- lib/Cake/Model/Validator/CakeValidationRule.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Model/Validator/CakeValidationRule.php b/lib/Cake/Model/Validator/CakeValidationRule.php index 8ebf82589..1c153e1f9 100644 --- a/lib/Cake/Model/Validator/CakeValidationRule.php +++ b/lib/Cake/Model/Validator/CakeValidationRule.php @@ -274,7 +274,7 @@ class CakeValidationRule { $this->_valid = call_user_func_array(array('Validation', $this->_rule), $this->_ruleParams); } elseif (is_string($validator['rule'])) { $this->_valid = preg_match($this->_rule, $data[$field]); - } elseif (Configure::read('debug') > 0) { + } else { trigger_error(__d('cake_dev', 'Could not find validation handler %s for %s', $this->_rule, $field), E_USER_WARNING); return false; }