r80918 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80917‎ | r80918 | r80919 >
Date:21:13, 24 January 2011
Author:hashar
Status:ok (Comments)
Tags:
Comment:
Email validation for @localhost address + tests

See r80694 commit note
Modified paths:
  • /trunk/phase3/resources/mediawiki.util/mediawiki.util.js (modified) (history)
  • /trunk/phase3/resources/mediawiki.util/mediawiki.util.test.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki.util/mediawiki.util.test.js
@@ -279,6 +279,16 @@
280280 mw.test.addTest( 'typeof $.fn.makeCollapsible',
281281 'function (string)' );
282282
 283+ // Email validation
 284+ // TODO: import tests from PHPUnit test suite
 285+ mw.test.addHead( 'Email validation' );
 286+
 287+ mw.test.addTest( 'mw.util.validateEmail( "" )',
 288+ 'null (object)' );
 289+
 290+ mw.test.addTest( 'mw.util.validateEmail( "user@localhost" )',
 291+ 'true (boolean)' );
 292+
283293 // Run tests and compare results
284294 var exec,
285295 result,
@@ -326,4 +336,4 @@
327337
328338 mediaWiki.test.init();
329339
330 -} )(jQuery, mediaWiki);
\ No newline at end of file
 340+} )(jQuery, mediaWiki);
Index: trunk/phase3/resources/mediawiki.util/mediawiki.util.js
@@ -501,8 +501,8 @@
502502 // Domain first part
503503 '[' + rfc1034_ldh_str + ']+'
504504 +
505 - // Second part and following are separated by a dot
506 - '(?:\\.[' + rfc1034_ldh_str + ']+)+'
 505+ // Optional second part and following are separated by a dot
 506+ '(?:\\.[' + rfc1034_ldh_str + ']+)*'
507507 +
508508 // End of string
509509 '$',

Follow-up revisions

RevisionCommit summaryAuthorDate
r810001.17: MFT r80576, r80583, r80656, r80842, r80900, r80913, r80918, r80919, r80...catrope22:49, 25 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80694Hack invalid w3 spec to validate @localhost email...hashar18:01, 21 January 2011

Comments

#Comment by Hashar (talk | contribs)   21:15, 24 January 2011

This one MUST be in 1.17 just like it is PHP counterpart r80694 . Spotted by Roan on IRC. Tests thanks to Krinkle.

Status & tagging log