Fix a bug related to checking content's length.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8480 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-06-15 07:40:53 +00:00
parent 9142149a3a
commit 26c3fce74f
4 changed files with 89 additions and 38 deletions

View file

@ -158,7 +158,7 @@ class Validator
$strlength = $this->_has_mb_func?mb_strlen($value,'utf-8'):$this->mbStrLen($value);
}
if($min > ($is_min_b?$strbytes:$strlength) || $max < ($is_max_b?$strbytes:$strlength)) return $this->error($key, 'outofrange');
if(($min && $min > ($is_min_b?$strbytes:$strlength)) || ($max && $max < ($is_max_b?$strbytes:$strlength))) return $this->error($key, 'outofrange');
}
// equalto