From: hickert Date: Mon, 12 Mar 2007 14:55:41 +0000 (+0000) Subject: Updated redirect class X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6a4ddd21c9e7376d5b7a30f31f043669bd40af45;p=gosa.git Updated redirect class git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5769 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/sieve/class_sieveElements.inc b/include/sieve/class_sieveElements.inc index 511e836c9..3b84ebdf4 100644 --- a/include/sieve/class_sieveElements.inc +++ b/include/sieve/class_sieveElements.inc @@ -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);