Skip to content

Commit

Permalink
Fixed #1283: Unable to import .info emails (thanks to bkgray)
Browse files Browse the repository at this point in the history
git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/stable_plus@3382 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Thibault Le Meur committed Oct 16, 2007
1 parent 5a3ba52 commit 572ca8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion admin/tokens.php
Expand Up @@ -1448,7 +1448,7 @@
else
{
$line[2] = trim($line[2]);
if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $line[2]))
if (!validate_email($line[2]))
{
$xe++;
} else
Expand Down
5 changes: 4 additions & 1 deletion common.php
Expand Up @@ -1558,7 +1558,10 @@ function validate_email($email)
{
// Create the syntactical validation regular expression
// Validate the syntax
return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $email)) ? FALSE : TRUE;

// see http://data.iana.org/TLD/tlds-alpha-by-domain.txt
$maxrootdomainlength = 6;
return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,".$maxrootdomainlength."}$/ix", $email)) ? FALSE : TRUE;

}

Expand Down

0 comments on commit 572ca8f

Please sign in to comment.