Changeset 490 for trunk/lib/Validator.inc.php
- Timestamp:
- Sep 1, 2014 4:50:11 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Validator.inc.php
r487 r490 53 53 54 54 /** 55 * Ensures a value is empty.55 * Check if a value is not empty (just the opposite of isEmpty()). 56 56 * 57 57 * @param string $val The input data to validate. … … 60 60 static public function notEmpty($val) 61 61 { 62 return '' != trim((string)$val);63 } 64 65 /** 66 * Ensures a value is blank.62 return !self::isEmpty($val); 63 } 64 65 /** 66 * Check if a value is empty. 67 67 * 68 68 * @param string $val The input data to validate. … … 71 71 static public function isEmpty($val) 72 72 { 73 return '' == trim((string)$val); 73 if (is_array($val)) { 74 return empty($val); 75 } else { 76 return '' == trim((string)$val); 77 } 74 78 } 75 79
Note: See TracChangeset
for help on using the changeset viewer.