Parcourir la source

Test if email_validate function exists and fix change the indentation from spaces to tabs.

markjcrane il y a 9 ans
Parent
commit
664fb4351b
1 fichiers modifiés avec 14 ajouts et 12 suppressions
  1. 14 12
      resources/functions.php

+ 14 - 12
resources/functions.php

@@ -1326,17 +1326,19 @@ function number_pad($number,$n) {
 	}
 
 //email validate
-	function email_validate($strEmail){
-	   $validRegExp =  '/^[a-zA-Z0-9\._-]+@[a-zA-Z0-9\._-]+\.[a-zA-Z]{2,3}$/';
-	   // search email text for regular exp matches
-	   preg_match($validRegExp, $strEmail, $matches, PREG_OFFSET_CAPTURE);
-
-	   if (count($matches) == 0) {
-		return 0;
-	   }
-	   else {
-		return 1;
-	   }
-}
+	if (!function_exists('email_validate')) {
+		function email_validate($strEmail){
+			$validRegExp =  '/^[a-zA-Z0-9\._-]+@[a-zA-Z0-9\._-]+\.[a-zA-Z]{2,3}$/';
+			// search email text for regular exp matches
+			preg_match($validRegExp, $strEmail, $matches, PREG_OFFSET_CAPTURE);
+
+			if (count($matches) == 0) {
+				return 0;
+			}
+			else {
+				return 1;
+			}
+		}
+	}
 
 ?>