Changeset 127 for branches/2.0singleton/lib/FormValidator.inc.php
- Timestamp:
- May 25, 2006 10:21:07 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0singleton/lib/FormValidator.inc.php
r121 r127 389 389 function validateEmail($form_name) 390 390 { 391 $app =& App::getInstance(); 392 391 393 $email = getFormData($form_name); 392 394 if ('' == trim($email)) { … … 400 402 if (!preg_match($e->getParam('regex'), $email, $e_parts)) { 401 403 $this->addError($form_name, sprintf(_("<strong>%s</strong> is not a valid email address."), oTxt($email))); 402 App::logMsg(sprintf('The email address %s is not valid.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__);404 $app->logMsg(sprintf('The email address %s is not valid.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__); 403 405 return false; 404 406 } … … 412 414 if (strlen($local) > 64 || strlen($domain) > 191) { 413 415 $this->addError($form_name, sprintf(_("<strong>Email address</strong> must contain less than 256 characters."), oTxt($email))); 414 App::logMsg(sprintf('The email address %s must contain less than 256 characters.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__);416 $app->logMsg(sprintf('The email address %s must contain less than 256 characters.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__); 415 417 return false; 416 418 } … … 420 422 if ((ip2long($domain) == '-1' || ip2long($domain) === false) && function_exists('checkdnsrr') && !checkdnsrr($domain . '.', 'MX') && gethostbyname($domain) == $domain) { 421 423 $this->addError($form_name, sprintf(_("<strong>%s</strong> is not a valid email domain name"), oTxt($domain))); 422 App::logMsg(sprintf('The email address %s contains an invalid email domain name (%s).', getFormData($form_name), $domain), LOG_INFO, __FILE__, __LINE__);424 $app->logMsg(sprintf('The email address %s contains an invalid email domain name (%s).', getFormData($form_name), $domain), LOG_INFO, __FILE__, __LINE__); 423 425 return false; 424 426 } … … 454 456 function validateStrDate($form_name, $msg='') 455 457 { 458 $app =& App::getInstance(); 459 456 460 if (($timestamp = strtotime(getFormData($form_name, '0'))) === -1) { 457 461 $this->addError($form_name, $msg); 458 App::logMsg(sprintf('The string date %s is not valid.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__);462 $app->logMsg(sprintf('The string date %s is not valid.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__); 459 463 return false; 460 464 } else {
Note: See TracChangeset
for help on using the changeset viewer.