From 794bc9a8168d46973471138953946f71f9a56054 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 24 Jan 2011 21:18:47 +0000 Subject: [PATCH] Tweak comments on User::isValidEmailAddr to replace the old @todo for RFC 2822 validation with a brief explanation of why we're using this instead. (followup r80913) --- includes/User.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/includes/User.php b/includes/User.php index 104d0623cb..fc9dbb2be7 100644 --- a/includes/User.php +++ b/includes/User.php @@ -638,17 +638,25 @@ class User { /** * Does a string look like an e-mail address? * - * This validate an email address using an HTML5 specification found at: + * This validates an email address using an HTML5 specification found at: * http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address * Which as of 2011-01-24 says: + * * A valid e-mail address is a string that matches the ABNF production * 1*( atext / "." ) "@" ldh-str *( "." ldh-str ) where atext is defined * in RFC 5322 section 3.2.3, and ldh-str is defined in RFC 1034 section * 3.5. + * * This function is an implementation of the specification as requested in * bug 22449. * - * @todo Check for RFC 2822 compilance (bug 959) + * Client-side forms will use the same standard validation rules via JS or + * HTML 5 validation; additional restrictions can be enforced server-side + * by extensions via the 'isValidEmailAddr' hook. + * + * Note that this validation doesn't 100% match RFC 2822, but is believed + * to be liberal enough for wide use. Some invalid addresses will still + * pass validation here. * * @param $addr String E-mail address * @return Bool -- 2.20.1