?
Referenced as Pull Request for: # 7212
avatar berserkerx
berserkerx
18 Jun 2015

Steps to reproduce the issue

JMailHelper::isEmailAddress('q@7');

Expected result

false

Actual result

true

System information (as much as possible)

Joomla 3.4.1, OpenServer (Apache 2.2, PHP 5.3), MS Windows 7

Additional comments

The problem piece of code is (/libraries/joomla/mail/helper.php):

// No problem if the domain looks like an IP address, ish
$regex = '/^[0-9.]+$/';

if (preg_match($regex, $domain))
{
return true;
}

A bit better solution:

$regex = '^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.
([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])$';

Source: http://www.mkyong.com/regular-expressions/how-to-validate-ip-address-with-regular-expression/

avatar berserkerx berserkerx - open - 18 Jun 2015
avatar joomla-cms-bot joomla-cms-bot - change - 18 Jun 2015
Build 3.4.1 staging
avatar berserkerx berserkerx - change - 18 Jun 2015
The description was changed
avatar berserkerx berserkerx - change - 18 Jun 2015
The description was changed
avatar zero-24
zero-24 - comment - 19 Jun 2015

@berserkerx as you have code to fix the problem. Can you send your changes as Pull Request? If you need help try this doc: https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests else let us know what you need :smile:

avatar zero-24
zero-24 - comment - 19 Jun 2015

Closing as we have an pull request. Thanks @berserkerx #7212

avatar zero-24 zero-24 - change - 19 Jun 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-06-19 19:57:39
Closed_By zero-24
avatar zero-24 zero-24 - close - 19 Jun 2015

Add a Comment

Login with GitHub to post a comment