Skip to content

Commit

Permalink
Revert of "Use PHP's own email validation routines"
Browse files Browse the repository at this point in the history
This partially reverts commit 4235a08
which introduced a regression.

The PHP email validation rejects valid e-mail addresses with the form
user@hostname [1]. The PHPMailer accepts these, and furthermore it makes
sense to rely on the validation routine provided by the library we use
to send our emails.

[1] https://bugs.php.net/bug.php?id=49576
  • Loading branch information
dregad committed Jan 27, 2014
1 parent 86d30ed commit 50d235a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/email_api.php
Expand Up @@ -122,9 +122,9 @@ function email_is_valid( $p_email ) {
return true;
}

// check email address is a valid format
$t_email = filter_var($p_email, FILTER_SANITIZE_EMAIL);
if (filter_var($t_email, FILTER_VALIDATE_EMAIL)) {
# check email address is a valid format
$t_email = filter_var( $p_email, FILTER_SANITIZE_EMAIL );
if( PHPMailer::ValidateAddress( $t_email ) ) {
$t_domain = end( explode( '@', $t_email ) );

# see if we're limited to a set of known domains
Expand Down

0 comments on commit 50d235a

Please sign in to comment.