Index: trunk/phase3/maintenance/tests/phpunit/includes/UserIsValidEmailAddrTest.php |
— | — | @@ -27,7 +27,8 @@ |
28 | 28 | $this->valid( 'USER@eXAMPLE.com' ); |
29 | 29 | } |
30 | 30 | function testEmailWithAPlusInUserName() { |
31 | | - $this->valid( 'user+sub@localdomain' ); |
| 31 | + $this->valid( 'user+sub@example.com' ); |
| 32 | + $this->valid( 'user+@example.com' ); |
32 | 33 | } |
33 | 34 | function testEmailWithWhiteSpacesBeforeOrAfterAreInvalids() { |
34 | 35 | $this->invalid( " user@host" ); |
— | — | @@ -43,10 +44,10 @@ |
44 | 45 | function testEmailDomainCanNotBeginWithDot() { |
45 | 46 | $this->invalid( "user@." ); |
46 | 47 | $this->invalid( "user@.localdomain" ); |
47 | | - $this->valid( "user@localdomain." ); |
48 | | - $this->valid( "user.@localdomain" ); |
49 | | - $this->valid( ".@localdomain" ); |
50 | | - $this->valid( ".@a............" ); |
| 48 | + $this->invalid( "user@localdomain." ); |
| 49 | + $this->invalid( "user.@localdomain" ); |
| 50 | + $this->invalid( ".@localdomain" ); |
| 51 | + $this->invalid( ".@a............" ); |
51 | 52 | } |
52 | 53 | function testEmailWithFunnyCharacters() { |
53 | 54 | $this->valid( "\$user!ex{this}@123.com" ); |
Index: trunk/phase3/includes/User.php |
— | — | @@ -655,8 +655,8 @@ |
656 | 656 | ^ # start of string |
657 | 657 | [$rfc5322_atext\\.]+ # user part which is liberal :p |
658 | 658 | @ # 'apostrophe' |
659 | | - [$rfc1034_ldh_str] # Domain first character |
660 | | - [$rfc1034_ldh_str\\.]+ # Second char and following can include dot |
| 659 | + [$rfc1034_ldh_str]+ # First domain part |
| 660 | + (\\.[$rfc1034_ldh_str]+)+ # Following part prefixed with a dot |
661 | 661 | $ # End of string |
662 | 662 | /ix" ; // case Insensitive, eXtended |
663 | 663 | |
Index: trunk/phase3/resources/mediawiki.specials/mediawiki.specials.preferences.js |
— | — | @@ -112,11 +112,11 @@ |
113 | 113 | // "apostrophe" |
114 | 114 | '@' |
115 | 115 | + |
116 | | - // Domain first character |
117 | | - '[' + rfc1034_ldh_str + ']' |
| 116 | + // Domain first part |
| 117 | + '[' + rfc1034_ldh_str + ']+' |
118 | 118 | + |
119 | | - // second char and following can include dot |
120 | | - '[' + rfc1034_ldh_str + '\\.' + ']' + '+' |
| 119 | + // Second part and following are separated by a dot |
| 120 | + '(\\.[' + rfc1034_ldh_str + ']+)+' |
121 | 121 | + |
122 | 122 | // End of string |
123 | 123 | '$', |