In r75682, I have implemented a PHP function to validate email address
based on bug 22449. Siebrand pointed a w3.org specification which I
implemented. The spec is bugged since it requires a domain and a top
level domain!
I could either make the first part optional or alter the second part
to require 0 to x elements. I choose the later: s/+/*/
Should fix bug 22449 for good.
TESTS:
Added testEmailDoesNotNeedATopLevelDomain:
Made following emails valid:
user.@localdaomin
.@localdomain
user@a
Test output (please add more):
$ php phpunit.php -c suite.xml --filter alidEmail --tap
TAP version 13
ok 1 - UserIsValidEmailAddrTest::testEmailWellKnownUserAtHostDotTldAreValid
ok 2 - UserIsValidEmailAddrTest::testEmailWithUpperCaseCharactersAreValid
ok 3 - UserIsValidEmailAddrTest::testEmailWithAPlusInUserName
ok 4 - UserIsValidEmailAddrTest::testEmailDoesNotNeedATopLevelDomain
ok 5 - UserIsValidEmailAddrTest::testEmailWithWhiteSpacesBeforeOrAfterAreInvalids
ok 6 - UserIsValidEmailAddrTest::testEmailWithWhiteSpacesAreInvalids
ok 7 - UserIsValidEmailAddrTest::testEmailDomainCanNotBeginWithDot
ok 8 - UserIsValidEmailAddrTest::testEmailWithFunnyCharacters
ok 9 - UserIsValidEmailAddrTest::testEmailTopLevelDomainCanBeNumerical
ok 10 - UserIsValidEmailAddrTest::testEmailWithoutAtSignIsInvalid
ok 11 - UserIsValidEmailAddrTest::testEmailWithOneCharacterDomainIsValid
1..11
Fixed method call in Preprocessor_Native.php.
Added support for tags containing spaces (r80025), following the same odd order dependant behavior as the php preprocessors.
Extensions shouldn't rely on it. See http://thread.gmane.org/gmane.science.linguistics.wikipedia.technical/51496
As a result of these changes, there is much less worst-case lookahead now.
in_array.{c,h} are now unused.
The space is actually used inside extensions, such as Maps, covertly called as 'display_map' into
Validator, then converted into 'display map' by getName().
This might avoid confusion when testing. Currently, an email without
a tld is invalid (ex user@host). The assertions could have been
invalid just by the lack of tld, not the spaces!
instantiate a variable-length constructor in php 5.1.3 and up, and falls
back to the old, ugly, manual method that was in the old wfCreateObject
function. The instances in the core have been replaced.
Old: ApiWatchTest not only tested the watch module, but also tested the login module,
and the login module test was also used to log in to the API for the other tests.
New: ApiWatchTest only contains watch-specific methods. The login testing has been moved
to ApiTest. The code used to log in and get tokens have been moved to ApiSetup. Nice,
organized, and much nicer than before. ApiUploadTest is still pretty fugly, though.
-in_string has a case-insensitive option
-wfClientAcceptsGzip has a force option to force resetting the static value, useful for unit tests
Unit tests for more global functions added