Deprecated: Assigning the return value of new by reference is deprecated in /home/bluestat/public_html/source/index.php on line 477
ISSO - Commitdiff - ViewGit - Blue Static

Remove an unnecessary if/else and replace it with a single return statement

Robert Sesek [2009-01-05 03:27]
Remove an unnecessary if/else and replace it with a single return statement

* Functions.php:
(BSFunctions::is_valid_email)
Filename
Functions.php
diff --git a/Functions.php b/Functions.php
index 91a8eee..92195b5 100644
--- a/Functions.php
+++ b/Functions.php
@@ -213,14 +213,7 @@ class BSFunctions
 	 */
 	public static function is_valid_email($email)
 	{
-		if (preg_match('#^[a-z0-9\.\-\+_]+?@(.*?\.)*?[a-z0-9\-_]+?\.[a-z]{2,4}$#i', $email))
-		{
-			return true;
-		}
-		else
-		{
-			return false;
-		}
+		return (preg_match('#^[a-z0-9\.\-\+_]+?@(.*?\.)*?[a-z0-9\-_]+?\.[a-z]{2,4}$#i', $email));
 	}

 	/**