Permalink
Browse files

fix

thanks to @dereuromark
  • Loading branch information...
marcopeg committed Nov 3, 2012
1 parent 3c46cdd commit a785ded088b0f7e61b65d7bdf6dad4648998b220
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Cake/Model/Validator/CakeValidationRule.php
@@ -274,15 +274,15 @@ public function process($field, &$data, &$methods) {
$this->_valid = call_user_func_array($methods[$rule], $this->_ruleParams);
} elseif (class_exists('Validation') && method_exists('Validation', $this->_rule)) {
$this->_valid = call_user_func_array(array('Validation', $this->_rule), $this->_ruleParams);
- } elseif (strpos($this->_rule, '::')) {
+ } elseif (strpos($this->_rule, '::') !== false) {
list($plugin, $class) = pluginSplit($this->_rule);
list($className, $method) = explode('::', $class);
$location = 'Model/Validation';
if ($plugin) {
$location = $plugin . '.' . $location;
}
App::uses($className, $location);
- if ( is_callable(array($className,$method)) ) {
+ if (is_callable(array($className, $method))) {
$this->_valid = call_user_func_array(array($className, $method), $this->_ruleParams);
} else {
trigger_error(__d('cake_dev', 'Could not find custom validation rule %s', $this->_rule), E_USER_WARNING);

0 comments on commit a785ded

Please sign in to comment.