Changeset 305


Ignore:
Timestamp:
Jan 29, 2008 8:54:39 AM (16 years ago)
Author:
quinn
Message:

Fixed some errors in validateEmail.

File:
1 edited

Legend:

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

    r282 r305  
    433433
    434434        if ('' == trim($email)) {
    435             // No email address provided, and that's okay
     435            // No email address provided, and that's okay.
    436436            return true;
    437437        }
     
    441441        case VALIDATE_EMAIL_REGEX_FAIL:
    442442            // Failed regex match.
    443             $this->addError($form_name, sprintf(_("<em>%s</em> is not a valid email address."), oTxt($email)));
    444             $app->logMsg(sprintf('The email address %s is not valid.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__);
     443            $this->addError($form_name, sprintf(_("The email address <em>%s</em> is formatted incorrectly."), oTxt($email)));
     444            $app->logMsg(sprintf('The email address %s is not valid.', oTxt($email)), LOG_DEBUG, __FILE__, __LINE__);
    445445            return false;
    446446            break;
     447           
    447448        case VALIDATE_EMAIL_LENGTH_FAIL :
    448449            // Failed length requirements.
    449             $this->addError($form_name, sprintf(_("<em>Email address</em> must contain less than 256 characters."), oTxt($email)));
    450             $app->logMsg(sprintf('The email address %s must contain less than 256 characters.', getFormData($form_name)), LOG_DEBUG, __FILE__, __LINE__);
     450            $this->addError($form_name, sprintf(_("The email address <em>%s</em> is too long (email addresses must have fewer than 256 characters)."), oTxt($email)));
     451            $app->logMsg(sprintf('The email address %s must contain less than 256 characters.', oTxt($email)), LOG_DEBUG, __FILE__, __LINE__);
    451452            return false;
    452453            break;
     454           
    453455        case VALIDATE_EMAIL_MX_FAIL :
    454456            // Failed MX record test.
    455             $this->addError($form_name, sprintf(_("<em>%s</em> is not a valid email domain name"), oTxt($domain)));
    456             $app->logMsg(sprintf('The email address %s contains an invalid email domain name (%s).', getFormData($form_name), $domain), LOG_INFO, __FILE__, __LINE__);
     457            $this->addError($form_name, sprintf(_("The email address <em>%s</em> does not have a valid domain name"), oTxt($email));
     458            $app->logMsg(sprintf('The email address %s does not have a valid domain name.', oTxt($email)), LOG_INFO, __FILE__, __LINE__);
    457459            return false;
    458460            break;
     461           
    459462        case VALIDATE_EMAIL_SUCCESS :
    460463        default :
Note: See TracChangeset for help on using the changeset viewer.