Bug 26948 - hyphens incorrectly interpreted as range
authorAntoine Musso <hashar@users.mediawiki.org>
Thu, 27 Jan 2011 20:52:12 +0000 (20:52 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Thu, 27 Jan 2011 20:52:12 +0000 (20:52 +0000)
commitff5fb5ea3e2f2a4d103fcf2ca527ad11ac34c657
tree974cd3e63f73f82e9a354cc44bbb791fb5d3fd5f
parent5a107a02d4efb5498283ca235f4ae3de397d2016
Bug 26948 - hyphens incorrectly interpreted as range

This is the kind of easy to fix, hard to review bug. Email validation
make uses of strings listing characters, those strings are then
enclosed between brackets "[]". Inside brackets, the hyphen is used
to describe a range of character [a-d] being a b c d.
The string containing an unescaped hyphen, made JS/PHP validation
to match the incorrect comma ",".

* Backslash hyphen
* JS,PHP: add tests for commas and hyphens in username or domain
* JS: add var to rfc_1034_ldh_str
* JS: minor code cleanup

TESTS:

php phpunit.php -c suite.xml --filter ValidEmail
OK (13 tests, 32 assertions)

Special:BlankPage?action=mwutiltest&debug=true
Ran 66 tests. 66 passed test(s). 0 error(s). 0 partially passed test(s).
includes/User.php
resources/mediawiki.util/mediawiki.util.js
resources/mediawiki.util/mediawiki.util.test.js
tests/phpunit/includes/UserIsValidEmailAddrTest.php