summaryrefslogtreecommitdiff
path: root/plugins/managesieve
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-01-14 10:25:57 -0500
committerAleksander Machniak <alec@alec.pl>2015-01-14 10:25:57 -0500
commit501cdd651e31508a075deeb002037624b69a07c6 (patch)
tree4475f8efc1d22d26749c63c681131f89fab8480c /plugins/managesieve
parent6af79f1517d4a5c34088eaf6d0e5af69733f3eef (diff)
Fix bug where vacation rule was saved to wrong script if managesieve_kolab_master=true
Diffstat (limited to 'plugins/managesieve')
-rw-r--r--plugins/managesieve/Changelog1
-rw-r--r--plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php8
2 files changed, 7 insertions, 2 deletions
diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog
index af22bccc9..769fd089f 100644
--- a/plugins/managesieve/Changelog
+++ b/plugins/managesieve/Changelog
@@ -1,5 +1,6 @@
- Fix bug where actions without if/elseif/else in sieve scripts were skipped
- Support "not allof" test as a negation of all sub-tests
+- Fix bug where vacation rule was saved to wrong script if managesieve_kolab_master=true
* version 8.1 [2014-12-09]
-----------------------------------------------------------
diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
index 035b26720..506484c7d 100644
--- a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
+++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
@@ -227,7 +227,7 @@ class rcube_sieve_engine
if ($script_name === null || $script_name === '') {
// get (first) active script
- if (!empty($this->active[0])) {
+ if (!empty($this->active)) {
$script_name = $this->active[0];
}
else if ($list) {
@@ -2078,7 +2078,6 @@ class rcube_sieve_engine
// Handle active script(s) and list of scripts according to Kolab's KEP:14
if ($this->rc->config->get('managesieve_kolab_master')) {
-
// Skip protected names
foreach ((array)$this->list as $idx => $name) {
$_name = strtoupper($name);
@@ -2140,6 +2139,11 @@ class rcube_sieve_engine
}
}
+ // reindex
+ if (!empty($this->list)) {
+ $this->list = array_values($this->list);
+ }
+
return $this->list;
}