1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 18:54:08 +02:00

Merge branch 'ticket/ckwalsh/9715' into develop-olympus

* ticket/ckwalsh/9715:
  [ticket/9715] Better email regex
  [ticket/9715] Extend email unit tests
This commit is contained in:
Andreas Fischer
2010-07-12 01:56:00 +02:00
2 changed files with 44 additions and 1 deletions

View File

@@ -3355,7 +3355,9 @@ function get_preg_expression($mode)
switch ($mode)
{
case 'email':
return '(?:[a-z0-9\'\.\-_\+\|]++|&)+@[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\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&)+@((((([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':