Permalink
Browse files

Revert of "Use PHP's own email validation routines"

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...
1 parent 86d30ed commit 50d235ad101f61a6c6888316e827fd225ad4b9cd @dregad dregad committed Jan 27, 2014
Showing with 3 additions and 3 deletions.
  1. +3 −3 core/email_api.php
View
@@ -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

0 comments on commit 50d235a

Please sign in to comment.