Skip to content

Commit

Permalink
Domain must have at least one country code
Browse files Browse the repository at this point in the history
Domain must have at least one country code (except it is localhost)
  • Loading branch information
Kubik-Rubik committed Sep 19, 2012
1 parent 52a7264 commit 87e392e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libraries/joomla/mail/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,16 @@ public static function isEmailAddress($email)

// Check the domain
$domain_array = explode(".", rtrim($domain, '.'));

// Domain must have at least one country code (except it is localhost)
if (count($domain_array) < 2 && $domain_array[0] != 'localhost')
{
return false;
}

$regex = '/^[A-Za-z0-9-]{0,63}$/';
foreach ($domain_array as $domain)
{

// Must be something
if (!$domain)
{
Expand Down

0 comments on commit 87e392e

Please sign in to comment.