aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2010-07-12 01:56:00 +0200
committerAndreas Fischer <bantu@phpbb.com>2010-07-12 01:56:00 +0200
commitda256b33d93978f672aa07e0e94be585a7d1d2ee (patch)
tree39754d525d6fb4c1a08c9e67098da4d0eefc351d /phpBB/includes/functions.php
parentd869fc98042886de2926fad8f1f4f11949000b48 (diff)
parent593e193bdc7bab20ec8460348b2fe597355dccda (diff)
downloadforums-da256b33d93978f672aa07e0e94be585a7d1d2ee.tar
forums-da256b33d93978f672aa07e0e94be585a7d1d2ee.tar.gz
forums-da256b33d93978f672aa07e0e94be585a7d1d2ee.tar.bz2
forums-da256b33d93978f672aa07e0e94be585a7d1d2ee.tar.xz
forums-da256b33d93978f672aa07e0e94be585a7d1d2ee.zip
Merge branch 'ticket/ckwalsh/9715' into develop-olympus
* ticket/ckwalsh/9715: [ticket/9715] Better email regex [ticket/9715] Extend email unit tests
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 9c74a524ee..bc3d721de5 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -3355,7 +3355,9 @@ function get_preg_expression($mode)
switch ($mode)
{
case 'email':
- return '(?:[a-z0-9\'\.\-_\+\|]++|&amp;)+@[a-z0-9\-]+\.(?:[a-z0-9\-]+\.)*[a-z]+';
+ // Regex written by James Watts and Francisco Jose Martin Moreno
+ // http://fightingforalostcause.net/misc/2006/compare-email-regex.php
+ return '([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&amp;)+@((((([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})?)';
break;
case 'bbcode_htm':