Code

Fixed element loading for fileinto.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Mar 2007 08:13:15 +0000 (08:13 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Mar 2007 08:13:15 +0000 (08:13 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5919 594d385d-05f5-0310-b6e9-bd551577e9d8

include/sieve/class_sieveElement_Fileinto.inc

index de30a9a1fb99ca7b75abcc61603c9f8a79b85cc3..6ac66371ca6fca283c5b7971a0a38611744dcbb1 100644 (file)
@@ -2,7 +2,7 @@
 
 class sieve_fileinto 
 {
-  var $data     = array();
+  var $data     = "";
   var $object_id= -1;
   var $options  = array();
   var $parent   = NULL;
@@ -46,10 +46,17 @@ class sieve_fileinto
       $data = array('ELEMENTS' => array(array('class' => "quoted-string" ,"text" => $mbs[key($mbs)])));
     }
 
-    /* Set mailbox */
-    foreach($data['ELEMENTS'] as $node ){
+    /* Load element contents, should normaly be only one string 
+     *  but if we found more than one, just append the following strings.
+     */
+    foreach($data['ELEMENTS'] as $key => $node ){
       if(in_array($node['class'],array("quoted-string","text"))){
-        $this->data = preg_replace("/\"/","",$node['text']);
+        $tmp = sieve_get_strings($data['ELEMENTS'],$key);
+        if(count($tmp['STRINGS'])){
+          foreach($tmp['STRINGS'] as $str){
+            $this->data.= $str;
+          }
+        }
       }
     }