From: Rob Church Date: Tue, 10 Jul 2007 15:08:48 +0000 (+0000) Subject: Ditch redundant trim-and-length check X-Git-Tag: 1.31.0-rc.0~52163 X-Git-Url: http://git.cyclocoop.org/data/%7B%24admin_url%7Dconfig?a=commitdiff_plain;h=3eb2f669d62dec6d905202fb1572ff83b961147c;p=lhc%2Fweb%2Fwiklou.git Ditch redundant trim-and-length check --- diff --git a/includes/User.php b/includes/User.php index e17c253e50..939caf29ae 100644 --- a/includes/User.php +++ b/includes/User.php @@ -497,7 +497,7 @@ class User { } /** - * Does the string match roughly an email address ? + * Does a string look like an email address? * * There used to be a regular expression here, it got removed because it * rejected valid addresses. Actually just check if there is '@' somewhere @@ -506,12 +506,10 @@ class User { * @todo Check for RFC 2822 compilance (bug 959) * * @param string $addr email address - * @static * @return bool */ - static function isValidEmailAddr ( $addr ) { - return ( trim( $addr ) != '' ) && - (false !== strpos( $addr, '@' ) ); + public static function isValidEmailAddr( $addr ) { + return strpos( $addr, '@' ) !== false; } /**