From: hickert Date: Mon, 26 Mar 2007 10:20:18 +0000 (+0000) Subject: Updated sieve element IF X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=17dd7c6b4668b805dca7c169e8d7da268706dd21;p=gosa.git Updated sieve element IF git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5885 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/sieve/class_sieveElement_If.inc b/include/sieve/class_sieveElement_If.inc index 60b04c939..99f170df2 100644 --- a/include/sieve/class_sieveElement_If.inc +++ b/include/sieve/class_sieveElement_If.inc @@ -20,6 +20,7 @@ class sieve_if function sieve_if($elements,$object_id,$parent) { $this->parent = $parent; + $this->object_id = $object_id; /* Possible address parts we can select */ $this->address_parts = array( @@ -51,19 +52,22 @@ class sieve_if "gt" => _("greater than"), "ne" => _("not equal")); - /* Remove comments from tests */ - $tmp = array(); - foreach($elements['ELEMENTS'] as $ele){ - if($ele['class'] != "comment"){ - $tmp[] = $ele; + /* Skip parsing if this element is new */ + if($elements != NULL){ + + /* Remove comments from tests */ + $tmp = array(); + foreach($elements['ELEMENTS'] as $ele){ + if($ele['class'] != "comment"){ + $tmp[] = $ele; + } } - } - $elements['ELEMENTS'] = $tmp; + $elements['ELEMENTS'] = $tmp; - $this->object_id = $object_id; - if($elements!=NULL){ - $this->elements = $elements; - $this->_parsed = $this->_parse($elements['ELEMENTS'],1); + if($elements!=NULL){ + $this->elements = $elements; + $this->_parsed = $this->_parse($elements['ELEMENTS'],1); + } } }