JMailHelper::isEmailAddress('q@7');
false
true
Joomla 3.4.1, OpenServer (Apache 2.2, PHP 5.3), MS Windows 7
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/
Build | 3.4.1 | ⇒ | staging |
Closing as we have an pull request. Thanks @berserkerx #7212
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-06-19 19:57:39 |
Closed_By | ⇒ | zero-24 |
@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