summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2015-01-14 05:36:05 -0500
committerAleksander Machniak <alec@alec.pl>2015-01-14 05:36:05 -0500
commit1f9c9fea5529b2b2218f7b3f0e09bd804afc89ac (patch)
tree448bba628380dd3260d849836c3f8f01825cd360
parente44e51561d2329e8f1e9ec88901d3c757f067303 (diff)
Fix bug where actions without if/elseif/else in sieve scripts were skipped
-rw-r--r--plugins/managesieve/Changelog2
-rw-r--r--plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php7
2 files changed, 7 insertions, 2 deletions
diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog
index 3ac7741ad..13ef57764 100644
--- a/plugins/managesieve/Changelog
+++ b/plugins/managesieve/Changelog
@@ -1,3 +1,5 @@
+- Fix bug where actions without if/elseif/else in sieve scripts were skipped
+
* version 8.1 [2014-12-09]
-----------------------------------------------------------
- Added simple API to manage vacation rule
diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
index 25016c878..6ed876267 100644
--- a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
+++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
@@ -1270,8 +1270,11 @@ class rcube_sieve_engine
$out .= $hiddenfields->show();
// 'any' flag
- if (sizeof($scr['tests']) == 1 && $scr['tests'][0]['test'] == 'true' && !$scr['tests'][0]['not'])
+ if ((!isset($this->form) && empty($scr['tests']) && !empty($src))
+ || (sizeof($scr['tests']) == 1 && $scr['tests'][0]['test'] == 'true' && !$scr['tests'][0]['not'])
+ ) {
$any = true;
+ }
// filter name input
$field_id = '_name';
@@ -2282,7 +2285,7 @@ class rcube_sieve_engine
$i = 1;
foreach ($this->script as $idx => $filter) {
- if ($filter['type'] != 'if') {
+ if (empty($filter['actions'])) {
continue;
}
$fname = $filter['name'] ? $filter['name'] : "#$i";