Details
-
Type:
Improvement
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.9.7, 2.3.3, 3.7
-
Fix Version/s: 3.7
-
Component/s: Libraries
-
Labels:
-
Testing Instructions:
-
Affected Branches:MOODLE_19_STABLE, MOODLE_23_STABLE, MOODLE_37_STABLE
-
Fixed Branches:MOODLE_37_STABLE
-
Pull from Repository:
-
Pull Master Branch:arjen_validate_email
-
Pull Master Diff URL:
Description
http://en.wikipedia.org/wiki/E-mail_address
the current regular expression for valid_email function (lib/weblib.php) does not validate the domain name accordingly.
I proposed for modifying the regular expression so it matches the RFC specification.
proposed new regular expression:
preg_match('#^([^\.]([\!\#\$\%\&\'\*\+\-\/=\?\^\_`\{\|\}\~a-z0-9]+\.)*' .
|
'[\!\#\$\%\&\'\*\+\-\/=\?\^\_`\{\|\}\~a-z0-9]+)' .
|
'@' .
|
'(([a-z0-9\_\-]{1,64}\.)*[a-z0-9\_\-]{1,64})$#i',
|
$address);
|