From d168b9909acc66510bd24b3e74f6828f47939f75 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Tue, 08 Sep 2009 07:51:49 -0400
Subject: [PATCH] - managesieve: Fix handling of "true" as "anyof (true)" test

---
 plugins/managesieve/lib/rcube_sieve.php |    4 ++--
 plugins/managesieve/Changelog           |    5 +++++
 plugins/managesieve/managesieve.php     |    2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog
index 45abafa..e68e9c7 100644
--- a/plugins/managesieve/Changelog
+++ b/plugins/managesieve/Changelog
@@ -1,3 +1,8 @@
+* version 1.6 [2009-09-08]
+-----------------------------------------------------------
+- Fix warning when importing squirrelmail rules
+- Fix handling of "true" as "anyof (true)" test
+
 * version 1.5 [2009-09-04]
 -----------------------------------------------------------
 - Added es_ES, ua_UA localizations
diff --git a/plugins/managesieve/lib/rcube_sieve.php b/plugins/managesieve/lib/rcube_sieve.php
index 59f7cfc..2ab30c5 100644
--- a/plugins/managesieve/lib/rcube_sieve.php
+++ b/plugins/managesieve/lib/rcube_sieve.php
@@ -442,7 +442,7 @@
     {
       $result = NULL;
     
-      if (preg_match('/^(if|elsif|else)\s+((allof|anyof|exists|header|not|size)\s+(.*))\s+\{(.*)\}$/sm', trim($content), $matches))
+      if (preg_match('/^(if|elsif|else)\s+((true|not\s+true|allof|anyof|exists|header|not|size)(.*))\s+\{(.*)\}$/sm', trim($content), $matches))
         {
 	  list($tests, $join) = $this->_parse_tests(trim($matches[2]));
 	  $actions = $this->_parse_actions(trim($matches[5]));
@@ -454,7 +454,7 @@
 		    'join' => $join,
 	    );
 	}
-    
+
       return $result;
     }    
 
diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php
index b2b52d4..bfbded9 100644
--- a/plugins/managesieve/managesieve.php
+++ b/plugins/managesieve/managesieve.php
@@ -7,7 +7,7 @@
  * It's clickable interface which operates on text scripts and communicates
  * with server using managesieve protocol. Adds Filters tab in Settings.
  *
- * @version 1.5
+ * @version 1.6
  * @author Aleksander 'A.L.E.C' Machniak <alec@alec.pl>
  *
  * Configuration (see config.inc.php.dist):

--
Gitblit v1.9.1