Ignore:
Timestamp:
Sep 1, 2014 4:50:11 PM (10 years ago)
Author:
anonymous
Message:

Increased robustness of Email(); added envelope_sender_address param. Clarity in Validator class.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Validator.inc.php

    r487 r490  
    5353
    5454    /**
    55      * Ensures a value is empty.
     55     * Check if a value is not empty (just the opposite of isEmpty()).
    5656     *
    5757     * @param  string $val The input data to validate.
     
    6060    static public function notEmpty($val)
    6161    {
    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.
    6767     *
    6868     * @param  string $val The input data to validate.
     
    7171    static public function isEmpty($val)
    7272    {
    73         return '' == trim((string)$val);
     73        if (is_array($val)) {
     74            return empty($val);
     75        } else {
     76            return '' == trim((string)$val);
     77        }
    7478    }
    7579
Note: See TracChangeset for help on using the changeset viewer.