Remove an unnecessary if/else and replace it with a single return statement
Remove an unnecessary if/else and replace it with a single return statement
* Functions.php:
(BSFunctions::is_valid_email)
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));
}
/**