Changeset 459


Ignore:
Timestamp:
Jan 27, 2014 5:52:20 PM (10 years ago)
Author:
anonymous
Message:

Revent null values going to validateStrDate

Location:
trunk/lib
Files:
2 edited

Legend:

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

    r413 r459  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    7070    // Array filling with error messages.
    7171    var $errors = array();
    72    
     72
    7373    /**
    7474     * Set (or overwrite existing) parameters by passing an array of new parameters.
     
    8080    {
    8181        $app =& App::getInstance();
    82    
     82
    8383        if (isset($params) && is_array($params)) {
    8484            // Merge new parameters with old overriding only those passed.
     
    9999    {
    100100        $app =& App::getInstance();
    101    
     101
    102102        if (isset($this->_params[$param])) {
    103103            return $this->_params[$param];
     
    107107        }
    108108    }
    109    
     109
    110110    /**
    111111     * Return the current list of errors.
     
    159159            return false;
    160160        } else {
    161             return (sizeof($this->errors) > 0);           
     161            return (sizeof($this->errors) > 0);
    162162        }
    163163    }
     
    283283        }
    284284    }
    285    
     285
    286286    /*
    287287    * We were using the isEmpty method *wrong* all these years and should have been using notEmpty.
    288     * But the fact is the only use is to ensure a value is not empty, so this function simply becomes 
     288    * But the fact is the only use is to ensure a value is not empty, so this function simply becomes
    289289    * an alias of the one-true notEmpty() function.
    290290    * @since    03 Jun 2006 22:56:46
     
    482482            return false;
    483483            break;
    484            
     484
    485485        case VALIDATE_EMAIL_LENGTH_FAIL :
    486486            // Failed length requirements.
     
    489489            return false;
    490490            break;
    491            
     491
    492492        case VALIDATE_EMAIL_MX_FAIL :
    493493            // Failed MX record test.
     
    496496            return false;
    497497            break;
    498            
     498
    499499        case VALIDATE_EMAIL_SUCCESS :
    500500        default :
     
    535535        $app =& App::getInstance();
    536536
    537         if (parent::validateStrDate(getFormData($form_name))) {
     537        if (parent::validateStrDate(getFormData($form_name, ''))) {
    538538            return true;
    539539        } else {
     
    557557    {
    558558        $cc_num = getFormData($form_name);
    559        
     559
    560560        if (parent::validateCCNumber($cc_num, $cc_type)) {
    561561            return true;
  • trunk/lib/Validator.inc.php

    r457 r459  
    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.
Note: See TracChangeset for help on using the changeset viewer.