Code

Replaced in_array calls with in_array_strict
[gosa.git] / gosa-plugins / mail / personal / mail / sieve / class_sieveElement_If.inc
index f0802aefd050d54c23b35b65b1035e13f8b7f229..4412f3fe6a0a3d86062c8f01f137b9fca633c725 100644 (file)
@@ -37,7 +37,7 @@ class sieve_if
     /* Match types */
     $this->match_types  = array(  
         ":is"         => _("is"),
-        ":regex"      => _("regex"),
+        ":regex"      => _("reg-ex"),
         ":contains"   => _("contains"),
         ":matches"    => _("matches"),
         ":count"      => _("count"),
@@ -236,7 +236,7 @@ class sieve_if
           $script .= $data['Match_type']." ";
 
           /* Add special match type for count and value */
-          if(in_array($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
+          if(in_array_strict($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
             $script .= sieve_create_strings($data['Match_type_value'])." ";
           }
 
@@ -281,7 +281,7 @@ class sieve_if
           $script .= $data['Match_type']." ";
 
           /* Add special match type for count and value */
-          if(in_array($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
+          if(in_array_strict($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
             $script .= sieve_create_strings($data['Match_type_value'])." ";
           }
 
@@ -327,7 +327,7 @@ class sieve_if
           $script .= $data['Match_type']." ";
 
           /* Add special match type for count and value */
-          if(in_array($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
+          if(in_array_strict($data['Match_type'], array(":value",":count")) && !empty($data['Match_type_value'])) {
             $script .= sieve_create_strings($data['Match_type_value'])." ";
           }
 
@@ -443,7 +443,7 @@ class sieve_if
                                 "LastError"       => "",
                                 "Match_type"      => ":contains",
                                 "Match_type_value"=> "",
-                                "Key_List"        => array(_("emtpy")),
+                                "Key_List"        => array(_("empty")),
                                 "Value_List"      => array(_("empty"))) ;
         if($type == "address"){
           $values["Address_Part"]    = ":all";
@@ -630,7 +630,7 @@ class sieve_if
           /* In case of :count and :value match types 
            *  we have a special match operator we should save.
            */
-          if(in_array($parsed[$key]['Match_type'],array(":value",":count"))){
+          if(in_array_strict($parsed[$key]['Match_type'],array(":value",":count"))){
             if(isset($_POST['operator_'.$element_id])){
               $op = $_POST['operator_'.$element_id];
 
@@ -1173,7 +1173,7 @@ class sieve_if
         } 
         default : 
         {
-          trigger_error(_("Unhandled switch type"));
+          trigger_error(_("Unknown switch type"));
         }
       }
     }
@@ -1266,7 +1266,7 @@ class sieve_if
             $Match_type = $node['text'];
 
             /* Get value operator */
-            if(in_array($Match_type,array(":value",":count"))){
+            if(in_array_strict($Match_type,array(":value",":count"))){
               $i ++;        
               $node = $data[$i];
 
@@ -1380,7 +1380,7 @@ class sieve_if
         
         /* Skip first values, [if,not,exists] */
         $node = $data[$id];
-        while(in_array($node['text'],array("if","not","exists"))){
+        while(in_array_strict($node['text'],array("if","not","exists"))){
           $id ++;
           $node = $data[$id];
         }
@@ -1448,16 +1448,16 @@ class sieve_if
     $next = NULL;
     $num = 0;
     for($i = $id ; $i < count($data) ; $i++ ){
-      if(in_array($data[$i]['class'],array("left-parant","left-bracket"))){
+      if(in_array_strict($data[$i]['class'],array("left-parant","left-bracket"))){
         $open_brakets ++;
       }
       if($data[$i]['class'] == "comma" && $open_brakets == 1){
         $num ++;
       }
-      if(!in_array($data[$i]['class'],array("comma","left-parant","right-parant")) || $open_brakets >1 ){
+      if(!in_array_strict($data[$i]['class'],array("comma","left-parant","right-parant")) || $open_brakets >1 ){
         $par[$num][] = $data[$i];
       }
-      if(in_array($data[$i]['class'],array("right-parant","right-bracket"))){
+      if(in_array_strict($data[$i]['class'],array("right-parant","right-bracket"))){
         $open_brakets --;
       }
     }