summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-08-02 13:23:37 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-08-02 13:23:37 +0000
commit125f2397b4f8704d2d21f64185fe97f19d5c231d (patch)
treeaabb5c720deee391cbbbf7d1ff2b7d0deec75d0d
parent187b7cd4e3f3bb02c39544ddc00626febb8ffda3 (diff)
- Fixed vacation parameters parsing (#1486883)
git-svn-id: https://svn.roundcube.net/trunk@3855 208e9e7b-5314-0410-a742-e7e81cd9613c
-rw-r--r--plugins/managesieve/Changelog4
-rw-r--r--plugins/managesieve/lib/rcube_sieve.php32
-rw-r--r--plugins/managesieve/managesieve.php2
3 files changed, 21 insertions, 17 deletions
diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog
index 96c4fe0fd..8c5a90456 100644
--- a/plugins/managesieve/Changelog
+++ b/plugins/managesieve/Changelog
@@ -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)
diff --git a/plugins/managesieve/lib/rcube_sieve.php b/plugins/managesieve/lib/rcube_sieve.php
index 7333d1dcd..7c397254a 100644
--- a/plugins/managesieve/lib/rcube_sieve.php
+++ b/plugins/managesieve/lib/rcube_sieve.php
@@ -751,32 +751,32 @@ class rcube_sieve_script
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);
}
diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php
index cc71dd81f..4f4d7b133 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 2.8
+ * @version 2.9
* @author Aleksander 'A.L.E.C' Machniak <alec@alec.pl>
*
* Configuration (see config.inc.php.dist)