diff options
| author | Nils Adermann <naderman@naderman.de> | 2012-05-31 15:29:33 +0200 |
|---|---|---|
| committer | Nils Adermann <naderman@naderman.de> | 2012-05-31 15:29:33 +0200 |
| commit | f6f300d3f9366a2c63e1b2dc4d8f35574c51ed4b (patch) | |
| tree | ad10cf02098cc7884727af04e1e3ec2c4aacbc6e | |
| parent | b789758f1bf431accb1226ff34f28e25c7ebe5c6 (diff) | |
| parent | 037b95eccc1f039e687360d9f804f7323a65e9df (diff) | |
| download | forums-f6f300d3f9366a2c63e1b2dc4d8f35574c51ed4b.tar forums-f6f300d3f9366a2c63e1b2dc4d8f35574c51ed4b.tar.gz forums-f6f300d3f9366a2c63e1b2dc4d8f35574c51ed4b.tar.bz2 forums-f6f300d3f9366a2c63e1b2dc4d8f35574c51ed4b.tar.xz forums-f6f300d3f9366a2c63e1b2dc4d8f35574c51ed4b.zip | |
Merge remote-tracking branch 'github-bantu/ticket/10162' into develop-olympus
By Andreas Fischer
via Andreas Fischer
* github-bantu/ticket/10162:
[ticket/10162] Increase maximum length of email address TLD from 6 to 63.
[ticket/10162] Add test cases for top level domain names longer than 6 chars.
| -rw-r--r-- | phpBB/includes/functions.php | 2 | ||||
| -rw-r--r-- | tests/regex/email_test.php | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index bc811cc75b..5914831539 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3456,7 +3456,7 @@ function get_preg_expression($mode) case 'email': // 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,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)'; + 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})?)'; break; case 'bbcode_htm': diff --git a/tests/regex/email_test.php b/tests/regex/email_test.php index 17f93259c3..b4ea5b23aa 100644 --- a/tests/regex/email_test.php +++ b/tests/regex/email_test.php @@ -28,6 +28,8 @@ class phpbb_regex_email_test extends phpbb_test_case array('alice_foo@bar.phpbb.com'), array('alice+tag@foo.phpbb.com'), array('alice&tag@foo.phpbb.com'), + array('alice@phpbb.australia'), + array('alice@phpbb.topZlevelZdomainZnamesZcanZbeZupZtoZsixtyZthreeZcharactersZlong'), //array('"John Doe"@example.com'), //array('Alice@[192.168.2.1]'), // IPv4 @@ -96,6 +98,7 @@ class phpbb_regex_email_test extends phpbb_test_case array('! "#$%(),/;<>[]`|@invalidCharsInLocal.org'), array('invalidCharsInDomain@! "#$%(),/;<>_[]`|.org'), array('local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org'), + array('alice@phpbb.topZlevelZdomainZnamesZcanZbeZupZtoZsixtyZthreeZcharactersZlongZ'), ); } |
