From 8f169576872084c45978b831e41d659977945021 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 23 Mar 2007 08:09:32 +0000 Subject: [PATCH] Fixed comment handling inside tags git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5869 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/sieve/class_My_Tree.inc | 2 +- include/sieve/class_sieveElement_If.inc | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/sieve/class_My_Tree.inc b/include/sieve/class_My_Tree.inc index f54312d48..839f82e5f 100644 --- a/include/sieve/class_My_Tree.inc +++ b/include/sieve/class_My_Tree.inc @@ -131,7 +131,7 @@ class My_Tree extends Tree } /* We can't handle comments within if tag right now */ - if($last_type != "if"){ + if(!in_array_ics($last_type,array("if","elsif"))){ /* Comments require special attention. * We do not want to create a single comment element diff --git a/include/sieve/class_sieveElement_If.inc b/include/sieve/class_sieveElement_If.inc index 56a25b385..60b04c939 100644 --- a/include/sieve/class_sieveElement_If.inc +++ b/include/sieve/class_sieveElement_If.inc @@ -51,6 +51,15 @@ 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; + } + } + $elements['ELEMENTS'] = $tmp; + $this->object_id = $object_id; if($elements!=NULL){ $this->elements = $elements; -- 2.30.2