Index: trunk/phase3/includes/User.php |
— | — | @@ -638,18 +638,26 @@ |
639 | 639 | /** |
640 | 640 | * Does a string look like an e-mail address? |
641 | 641 | * |
642 | | - * This validate an email address using an HTML5 specification found at: |
| 642 | + * This validates an email address using an HTML5 specification found at: |
643 | 643 | * http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#valid-e-mail-address |
644 | 644 | * Which as of 2011-01-24 says: |
| 645 | + * |
645 | 646 | * A valid e-mail address is a string that matches the ABNF production |
646 | 647 | * 1*( atext / "." ) "@" ldh-str *( "." ldh-str ) where atext is defined |
647 | 648 | * in RFC 5322 section 3.2.3, and ldh-str is defined in RFC 1034 section |
648 | 649 | * 3.5. |
| 650 | + * |
649 | 651 | * This function is an implementation of the specification as requested in |
650 | 652 | * bug 22449. |
651 | 653 | * |
652 | | - * @todo Check for RFC 2822 compilance (bug 959) |
| 654 | + * Client-side forms will use the same standard validation rules via JS or |
| 655 | + * HTML 5 validation; additional restrictions can be enforced server-side |
| 656 | + * by extensions via the 'isValidEmailAddr' hook. |
653 | 657 | * |
| 658 | + * Note that this validation doesn't 100% match RFC 2822, but is believed |
| 659 | + * to be liberal enough for wide use. Some invalid addresses will still |
| 660 | + * pass validation here. |
| 661 | + * |
654 | 662 | * @param $addr String E-mail address |
655 | 663 | * @return Bool |
656 | 664 | */ |