Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Making sure the Validation class exists before checking methods on it

  • Loading branch information...
commit 67d18b0c59c795da5e878360af68faf3ff75d51f 1 parent 7b58636
@lorenzo lorenzo authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/Cake/Model/Model.php
View
2  lib/Cake/Model/Model.php
@@ -3078,7 +3078,7 @@ public function invalidFields($options = array()) {
$ruleParams[] = $validator;
$ruleParams[0] = array($fieldName => $ruleParams[0]);
$valid = $this->Behaviors->dispatchMethod($this, $rule, $ruleParams);
- } elseif (method_exists('Validation', $rule)) {
+ } elseif (class_exists('Validation') && method_exists('Validation', $rule)) {
$valid = call_user_func_array(array('Validation', $rule), $ruleParams);
} elseif (!is_array($validator['rule'])) {
$valid = preg_match($rule, $data[$fieldName]);
Please sign in to comment.
Something went wrong with that request. Please try again.