Code

Updated in_array checks in GOsa.
[gosa.git] / gosa-core / include / utils / class_tests.inc
index 602ce0623bf7666230bab6df4c52e62e7723e0a3..2bfbf0d46afebd3544398cff6be007dbf9898c24 100644 (file)
@@ -155,7 +155,7 @@ class tests {
                           "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/","",$ip);
 
                   $mask = preg_replace("/^\//","",$mask);
-                  if((in_array("$mask",$res)) && preg_match("/^[0-9\.]/",$mask)){
+                  if((in_array_strict("$mask",$res)) && preg_match("/^[0-9\.]/",$mask)){
                           return(TRUE);
                   }
           }
@@ -205,7 +205,7 @@ class tests {
       return (TRUE);
     }
     if ($template){
-      return preg_match ("/^[._a-z0-9%\+-]+@[_a-z0-9-]+(\.[a-z0-9-]+)(\.[a-z0-9-]+)*$/i",
+      return preg_match ("/^[._a-z0-9{\[\]}%\+-]+@[_a-{}\[\]%z0-9-]+(\.[a-z0-9-]+)(\.[a-z0-9-]+)*$/i",
           $address);
     } else {
       return preg_match ("/^[._a-z0-9\+-]+@[_a-z0-9-]+(\.[a-z0-9i-]+)(\.[a-z0-9-]+)*$/i",