Code

Updated redirect class
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 12 Mar 2007 14:55:41 +0000 (14:55 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 12 Mar 2007 14:55:41 +0000 (14:55 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5769 594d385d-05f5-0310-b6e9-bd551577e9d8

include/sieve/class_sieveElements.inc

index 511e836c9207212628fe1d66fc70a11fecf5990a..3b84ebdf436b02f1e23b5bad3ccace3156954ab3 100644 (file)
@@ -243,12 +243,8 @@ class sieve_redirect
     if(isset($_POST['redirect_to_'.$this->object_id])){
       $rt = stripslashes($_POST['redirect_to_'.$this->object_id]);
 
-      $tmp = array();
-      $tmp2 = split(",",$rt);
-      foreach($tmp2 as $val){
-        $tmp[] = "\"".trim(preg_replace("/\"/","",$val))."\"";
-      }
-      $this->data = $tmp;
+      $rt = "\"".trim(preg_replace("/\"/","",$rt))."\"";
+      $this->data = $rt;
     }
   }
 
@@ -257,7 +253,7 @@ class sieve_redirect
   {
     foreach($data['ELEMENTS'] as $node ){
       if(in_array($node['class'],array("quoted-string","text"))){
-        $this->data[] = $node['text'];
+        $this->data = $node['text'];
       }
     }
   }
@@ -265,23 +261,13 @@ class sieve_redirect
 
   function get_sieve_script_part()
   {
-    $tmp = "";
-    foreach($this->data as $dat){
-      $tmp.= "\"".$dat."\", ";
-    }
-    $tmp = preg_replace("/,$/","",trim($tmp));
-    $tmp = preg_replace ("/\"\"/","\"",$tmp);
-    return("redirect ".$tmp.";\n");
+    return("redirect ".sieve_create_strings($this->data).";\n");
   } 
    
  
   function execute()
   {
-    $values = "";
-    foreach($this->data as $key){
-      $values .= $key.", ";
-    }
-    $values = preg_replace("/,$/","",trim($values));
+    $values = $this->data;
 
     $smarty = get_smarty();
     $smarty->assign("ID", $this->object_id);