r23967 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23966‎ | r23967 | r23968 >
Date:15:08, 10 July 2007
Author:robchurch
Status:old
Tags:
Comment:
Ditch redundant trim-and-length check
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -497,7 +497,7 @@
498498 }
499499
500500 /**
501 - * Does the string match roughly an email address ?
 501+ * Does a string look like an email address?
502502 *
503503 * There used to be a regular expression here, it got removed because it
504504 * rejected valid addresses. Actually just check if there is '@' somewhere
@@ -506,12 +506,10 @@
507507 * @todo Check for RFC 2822 compilance (bug 959)
508508 *
509509 * @param string $addr email address
510 - * @static
511510 * @return bool
512511 */
513 - static function isValidEmailAddr ( $addr ) {
514 - return ( trim( $addr ) != '' ) &&
515 - (false !== strpos( $addr, '@' ) );
 512+ public static function isValidEmailAddr( $addr ) {
 513+ return strpos( $addr, '@' ) !== false;
516514 }
517515
518516 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r24096Merged revisions 23910-24094 via svnmerge from...david22:38, 14 July 2007

Status & tagging log