Ignore:
Timestamp:
Feb 19, 2014 2:28:00 AM (10 years ago)
Author:
anonymous
Message:

Merged in changes from trunk to finish Eli's branch.

Location:
branches/eli_branch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eli_branch

  • branches/eli_branch/lib/Validator.inc.php

    r450 r467  
    218218    /**
    219219     * 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.
    220221     *
    221222     * @param  string  $val The input data to validate.
     
    226227        $app =& App::getInstance();
    227228
    228         if ('' == trim($val)) {
     229        if (is_string($val) && '' === trim($val)) {
    229230            // Don't be too bothered about empty strings.
    230231            return true;
     
    232233
    233234        $timestamp = strtotime($val);
    234         // Return values change between php4 and php5.
    235         if ('' != trim($val) && ($timestamp === -1 || $timestamp === false)) {
     235        if (!$timestamp || $timestamp < 1) {
    236236            return false;
    237237        } else {
     
    239239        }
    240240    }
    241 
    242241
    243242    /**
Note: See TracChangeset for help on using the changeset viewer.