From b5b77363e2d3e34e205234ab61a1bff901f8fd0e Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 15 Mar 2007 11:51:02 +0000 Subject: [PATCH] Don't display warnings like 'x may not appear before y' git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5788 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/sieve/class_parser.inc | 2 +- include/sieve/class_semantics.inc | 3 ++- include/sieve/class_sieveManagement.inc | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/sieve/class_parser.inc b/include/sieve/class_parser.inc index 7ca1f9e3b..933232eca 100644 --- a/include/sieve/class_parser.inc +++ b/include/sieve/class_parser.inc @@ -109,7 +109,7 @@ class Parser $last = $this->tree_->getLastNode($parent_id); if (!$semantics->validAfter($last['text'])) { - return $this->error_('"'. $token['text'] .'" may not appear after "'. $last['text'] .'"'); + #return $this->error_('"'. $token['text'] .'" may not appear after "'. $last['text'] .'"'); } // Process eventual arguments diff --git a/include/sieve/class_semantics.inc b/include/sieve/class_semantics.inc index e37d5c631..6fa7c4b7d 100644 --- a/include/sieve/class_semantics.inc +++ b/include/sieve/class_semantics.inc @@ -163,7 +163,7 @@ class Semantics array('occurrences' => '?', 'regex' => ':mime', 'name' => 'mime') )), array('class' => 'string', 'occurrences' => '1', 'values' => array( - array('occurrences' => '1', 'regex' => '".*"', 'name' => 'reason') + array('occurrences' => '1', 'regex' => '.*', 'name' => 'reason') )) ) ); @@ -479,6 +479,7 @@ class Semantics $arg = &$this->s_['arguments'][0]; foreach ($arg['values'] as $val) { + if (preg_match('/^'. $val['regex'] .'$/m', $text)) { // Check if the argument value needs a 'require' diff --git a/include/sieve/class_sieveManagement.inc b/include/sieve/class_sieveManagement.inc index 0bf128d21..99237f539 100644 --- a/include/sieve/class_sieveManagement.inc +++ b/include/sieve/class_sieveManagement.inc @@ -268,7 +268,6 @@ class sieveManagement extends plugin /* Save currently edited sieve script. */ if(isset($_POST['save_sieve_changes'])){ $chk = $this->current_handler->check(); - $chk =array(); if(!count($chk)){ $sc = $this->scripts[$this->current_script]['SCRIPT']; -- 2.30.2