-
Bug
-
Resolution: Fixed
-
Minor
-
3.0.11
-
None
-
PHP 5.3.8 with PCRE 8.12 2011-01-15
The regexp for validating an e-mail address is defined in /includes/functions.php, function get_preg_expression($mode):
// Regex written by James Watts and Francisco Jose Martin Moreno
|
// http://fightingforalostcause.net/misc/2006/compare-email-regex.php
|
return '([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&)+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,63})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)';
|
[email=user@host.com]title[/email]
|
[email]user@host.com[/email]
|
When defining a custom BBCode you also have the option to use EMAIL as a token. However, you're unable to imitate the native e-mail BBCode which accepts the address as a parameter. As example: defining this will work, but using that BBCode in your posts will never be recognized/accepted:
[myemail={EMAIL}]{TEXT}[/myemail]
|
The reason for this is that the regexp for the e-mail address captures the subpatterns. After defining every subpattern to not be captured and re-submitting my custom BBCode in the ACP again (thus updating the database rowset) my very own BBCode also works like the native EMAIL BBcode with a parameter.
The correct regexp:
return '(?:[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&)+@(?:(?:(?:(?:(?:[a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,63})|(?:\d{1,3}\.){3}\d{1,3}(?:\:\d{1,5})?)';
|
Found while analyzing https://www.phpbb.com/community/viewtopic.php?f=71&t=2164409
- was obsoleted by solution of
-
PHPBB-11768 Integrate s9e\TextFormatter
- Unverified Fix