From 3eb2f669d62dec6d905202fb1572ff83b961147c Mon Sep 17 00:00:00 2001 From: Rob Church Date: Tue, 10 Jul 2007 15:08:48 +0000 Subject: [PATCH] Ditch redundant trim-and-length check --- includes/User.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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; } /** -- 2.20.1