Changeset 459
- Timestamp:
- Jan 27, 2014 5:52:20 PM (10 years ago)
- Location:
- trunk/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FormValidator.inc.php
r413 r459 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 70 70 // Array filling with error messages. 71 71 var $errors = array(); 72 72 73 73 /** 74 74 * Set (or overwrite existing) parameters by passing an array of new parameters. … … 80 80 { 81 81 $app =& App::getInstance(); 82 82 83 83 if (isset($params) && is_array($params)) { 84 84 // Merge new parameters with old overriding only those passed. … … 99 99 { 100 100 $app =& App::getInstance(); 101 101 102 102 if (isset($this->_params[$param])) { 103 103 return $this->_params[$param]; … … 107 107 } 108 108 } 109 109 110 110 /** 111 111 * Return the current list of errors. … … 159 159 return false; 160 160 } else { 161 return (sizeof($this->errors) > 0); 161 return (sizeof($this->errors) > 0); 162 162 } 163 163 } … … 283 283 } 284 284 } 285 285 286 286 /* 287 287 * 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 289 289 * an alias of the one-true notEmpty() function. 290 290 * @since 03 Jun 2006 22:56:46 … … 482 482 return false; 483 483 break; 484 484 485 485 case VALIDATE_EMAIL_LENGTH_FAIL : 486 486 // Failed length requirements. … … 489 489 return false; 490 490 break; 491 491 492 492 case VALIDATE_EMAIL_MX_FAIL : 493 493 // Failed MX record test. … … 496 496 return false; 497 497 break; 498 498 499 499 case VALIDATE_EMAIL_SUCCESS : 500 500 default : … … 535 535 $app =& App::getInstance(); 536 536 537 if (parent::validateStrDate(getFormData($form_name ))) {537 if (parent::validateStrDate(getFormData($form_name, ''))) { 538 538 return true; 539 539 } else { … … 557 557 { 558 558 $cc_num = getFormData($form_name); 559 559 560 560 if (parent::validateCCNumber($cc_num, $cc_type)) { 561 561 return true; -
trunk/lib/Validator.inc.php
r457 r459 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.
Note: See TracChangeset
for help on using the changeset viewer.