Skip to content
Permalink
Browse files

Fixed strict checking of 'required' attributes.

  • Loading branch information...
Thomas Ploch
Thomas Ploch committed Feb 7, 2012
1 parent 4f3b266 commit 07b16987a395337a0e96428e58e19c372bb7f188
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/Cake/Model/Model.php
@@ -3016,14 +3016,14 @@ public function invalidFields($options = array()) {
}
$validator = array_merge($default, $validator);
if (!empty($validator['on']) || in_array($validator['required'], array('create', 'update'))) {
if (!empty($validator['on']) || in_array($validator['required'], array('create', 'update'), true)) {
if ($exists === null) {
$exists = $this->exists();
}
if ($validator['on'] == 'create' && $exists || $validator['on'] == 'update' && !$exists) {
continue;
}
if ($validator['required'] == 'create' && !$exists || $validator['required'] == 'update' && $exists) {
if ($validator['required'] === 'create' && !$exists || $validator['required'] === 'update' && $exists) {
$validator['required'] = true;
}
}

0 comments on commit 07b1698

Please sign in to comment.
You can’t perform that action at this time.