Adding fix for Ticket #2161

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4582 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-03-04 13:00:50 +00:00
parent 82c4b1e0a9
commit 0e44a16fbd

View file

@ -1676,7 +1676,7 @@ class Model extends Overloadable {
), $validator);
if (empty($validator['on']) || ($validator['on'] == 'create' && !$this->exists()) || ($validator['on'] == 'update' && $this->exists())) {
if (!isset($data[$fieldName]) && $validator['allowEmpty'] == false) {
if (empty($data[$fieldName]) && $validator['allowEmpty'] == false) {
$this->invalidate($fieldName, $validator['message']);
} elseif (isset($data[$fieldName])) {
if (is_array($validator['rule'])) {