diff --git a/lib/Cake/Model/Model.php b/lib/Cake/Model/Model.php index 4a2a69007..20c59e458 100644 --- a/lib/Cake/Model/Model.php +++ b/lib/Cake/Model/Model.php @@ -3016,14 +3016,14 @@ class Model extends Object implements CakeEventListener { } $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; } }