[Svn] r3855 - in trunk/plugins/managesieve: . lib

trac at roundcube.net trac at roundcube.net
Mon Aug 2 15:23:37 CEST 2010


Author: alec
Date: 2010-08-02 08:23:37 -0500 (Mon, 02 Aug 2010)
New Revision: 3855

Modified:
   trunk/plugins/managesieve/Changelog
   trunk/plugins/managesieve/lib/rcube_sieve.php
   trunk/plugins/managesieve/managesieve.php
Log:
- Fixed vacation parameters parsing (#1486883)


Modified: trunk/plugins/managesieve/Changelog
===================================================================
--- trunk/plugins/managesieve/Changelog	2010-08-02 10:29:22 UTC (rev 3854)
+++ trunk/plugins/managesieve/Changelog	2010-08-02 13:23:37 UTC (rev 3855)
@@ -1,3 +1,7 @@
+* version 2.9 [2010-08-02]
+-----------------------------------------------------------
+- Fixed vacation parameters parsing (#1486883)
+
 * version 2.8 [2010-07-08]
 -----------------------------------------------------------
 - Added managesieve_auth_type option (#1486731)

Modified: trunk/plugins/managesieve/lib/rcube_sieve.php
===================================================================
--- trunk/plugins/managesieve/lib/rcube_sieve.php	2010-08-02 10:29:22 UTC (rev 3854)
+++ trunk/plugins/managesieve/lib/rcube_sieve.php	2010-08-02 13:23:37 UTC (rev 3855)
@@ -751,32 +751,32 @@
                 else if(preg_match('/^vacation\s+(.*);$/sm', $content, $matches)) {
                     $vacation = array('type' => 'vacation');
 
-                    if (preg_match('/:(days)\s+([0-9]+)/', $content, $vm)) {
-                        $vacation['days'] = $vm[2];
-                        $content = preg_replace('/:(days)\s+([0-9]+)/', '', $content);
+                    if (preg_match('/:days\s+([0-9]+)/', $content, $vm)) {
+                        $vacation['days'] = $vm[1];
+                        $content = preg_replace('/:days\s+([0-9]+)/', '', $content);
                     }
-                    if (preg_match('/:(subject)\s+(".*?[^\\\]")/', $content, $vm)) {
-                        $vacation['subject'] = $vm[2];
-                        $content = preg_replace('/:(subject)\s+(".*?[^\\\]")/', '', $content);
+                    if (preg_match('/:subject\s+"(.*?[^\\\])"/', $content, $vm)) {
+                        $vacation['subject'] = $vm[1];
+                        $content = preg_replace('/:subject\s+"(.*?[^\\\])"/', '', $content);
                     }
-                    if (preg_match('/:(addresses)\s+\[(.*?[^\\\])\]/', $content, $vm)) {
-                        $vacation['addresses'] = $this->_parse_list($vm[2]);
-                        $content = preg_replace('/:(addresses)\s+\[(.*?[^\\\])\]/', '', $content);
+                    if (preg_match('/:addresses\s+\[(.*?[^\\\])\]/', $content, $vm)) {
+                        $vacation['addresses'] = $this->_parse_list($vm[1]);
+                        $content = preg_replace('/:addresses\s+\[(.*?[^\\\])\]/', '', $content);
                     }
-                    if (preg_match('/:(handle)\s+(".*?[^\\\]")/', $content, $vm)) {
-                        $vacation['handle'] = $vm[2];
-                    $content = preg_replace('/:(handle)\s+(".*?[^\\\]")/', '', $content);
+                    if (preg_match('/:handle\s+"(.*?[^\\\])"/', $content, $vm)) {
+                        $vacation['handle'] = $vm[1];
+                        $content = preg_replace('/:handle\s+"(.*?[^\\\])"/', '', $content);
                     }
-                    if (preg_match('/:(from)\s+(".*?[^\\\]")/', $content, $vm)) {
-                        $vacation['from'] = $vm[2];
-                        $content = preg_replace('/:(from)\s+(".*?[^\\\]")/', '', $content);
+                    if (preg_match('/:from\s+"(.*?[^\\\])"/', $content, $vm)) {
+                        $vacation['from'] = $vm[1];
+                        $content = preg_replace('/:from\s+"(.*?[^\\\])"/', '', $content);
                     }
 
                     $content = preg_replace('/^vacation/', '', $content);
                     $content = preg_replace('/;$/', '', $content);
                     $content = trim($content);
 
-                    if (preg_match('/^:(mime)/', $content, $vm)) {
+                    if (preg_match('/^:mime/', $content, $vm)) {
                         $vacation['mime'] = true;
                         $content = preg_replace('/^:mime/', '', $content);
                     }

Modified: trunk/plugins/managesieve/managesieve.php
===================================================================
--- trunk/plugins/managesieve/managesieve.php	2010-08-02 10:29:22 UTC (rev 3854)
+++ trunk/plugins/managesieve/managesieve.php	2010-08-02 13:23:37 UTC (rev 3855)
@@ -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 2.8
+ * @version 2.9
  * @author Aleksander 'A.L.E.C' Machniak <alec at alec.pl>
  *
  * Configuration (see config.inc.php.dist)

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list