Changeset 467 for branches/eli_branch/lib/Validator.inc.php
- Timestamp:
- Feb 19, 2014 2:28:00 AM (10 years ago)
- Location:
- branches/eli_branch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eli_branch
-
branches/eli_branch/lib/Validator.inc.php
r450 r467 218 218 /** 219 219 * Verifies that date can be processed by the strtotime function. 220 * Empty strings are considered valid. Other values are tested on their return value from strtotime(). Null values will fail. 220 221 * 221 222 * @param string $val The input data to validate. … … 226 227 $app =& App::getInstance(); 227 228 228 if ( ''== trim($val)) {229 if (is_string($val) && '' === trim($val)) { 229 230 // Don't be too bothered about empty strings. 230 231 return true; … … 232 233 233 234 $timestamp = strtotime($val); 234 // Return values change between php4 and php5. 235 if ('' != trim($val) && ($timestamp === -1 || $timestamp === false)) { 235 if (!$timestamp || $timestamp < 1) { 236 236 return false; 237 237 } else { … … 239 239 } 240 240 } 241 242 241 243 242 /**
Note: See TracChangeset
for help on using the changeset viewer.