Code

Added TZ fix
[gosa.git] / include / sieve / class_sieveElement_Fileinto.inc
index de30a9a1fb99ca7b75abcc61603c9f8a79b85cc3..dc3923f416975220c45ca29944871f42343d8719 100644 (file)
@@ -2,7 +2,7 @@
 
 class sieve_fileinto 
 {
-  var $data     = array();
+  var $data     = "";
   var $object_id= -1;
   var $options  = array();
   var $parent   = NULL;
@@ -42,14 +42,18 @@ class sieve_fileinto
     $mbs = $this->get_mail_boxes();
       
     /* Set the default mailbox */
-    if($data == NULL){
+    if($data === NULL){
       $data = array('ELEMENTS' => array(array('class' => "quoted-string" ,"text" => $mbs[key($mbs)])));
     }
 
-    /* Set mailbox */
-    foreach($data['ELEMENTS'] as $node ){
-      if(in_array($node['class'],array("quoted-string","text"))){
-        $this->data = preg_replace("/\"/","",$node['text']);
+    /* Load element contents, should normaly be only one string 
+     *  but if we found more than one, just append the following strings.
+     */
+    for($i = 0 ; $i < count($data['ELEMENTS']) ; $i++){
+      $tmp = sieve_get_strings($data['ELEMENTS'],$i);
+      $i  = $i + $tmp['OFFSET'];
+      foreach($tmp['STRINGS'] as $str){
+        $this->data .= $str;
       }
     }