Remove an unnecessary if/else and replace it with a single return statement
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 5 Jan 2009 03:27:20 +0000 (19:27 -0800)
committerRobert Sesek <rsesek@bluestatic.org>
Mon, 5 Jan 2009 03:27:20 +0000 (19:27 -0800)
* Functions.php:
(BSFunctions::is_valid_email)

Functions.php

index 91a8eeec6906f4bd2937461abaa1d3076eee4f47..92195b5af25427cbfcacc61e39518f905ea79be0 100644 (file)
@@ -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));
        }
        
        /**