From 6af79f1517d4a5c34088eaf6d0e5af69733f3eef Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 14 Jan 2015 07:30:31 -0500 Subject: Support "not allof" test as a negation of all sub-tests Fixes also last commit change. --- plugins/managesieve/Changelog | 1 + .../lib/Roundcube/rcube_sieve_engine.php | 56 +++++++++++++++++----- .../lib/Roundcube/rcube_sieve_script.php | 18 +++++-- 3 files changed, 58 insertions(+), 17 deletions(-) (limited to 'plugins') diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index 13ef57764..af22bccc9 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -1,4 +1,5 @@ - Fix bug where actions without if/elseif/else in sieve scripts were skipped +- Support "not allof" test as a negation of all sub-tests * 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 6ed876267..035b26720 100644 --- a/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php +++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php @@ -1270,7 +1270,7 @@ class rcube_sieve_engine $out .= $hiddenfields->show(); // 'any' flag - if ((!isset($this->form) && empty($scr['tests']) && !empty($src)) + if ((!isset($this->form) && empty($scr['tests']) && !empty($scr)) || (sizeof($scr['tests']) == 1 && $scr['tests'][0]['test'] == 'true' && !$scr['tests'][0]['not']) ) { $any = true; @@ -1335,7 +1335,7 @@ class rcube_sieve_engine $out .= sprintf("%s\n", $input_join, $field_id, rcube::Q($this->plugin->gettext('filterany'))); - $rows_num = isset($scr) ? sizeof($scr['tests']) : 1; + $rows_num = !empty($scr['tests']) ? sizeof($scr['tests']) : 1; $out .= '