From 13b98199ed4db269a9d263118dfdfdbb9d033251 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 20 Feb 2017 16:15:22 +0100 Subject: [PATCH] Managesieve: Fix parser issue with empty lines between comments (#5657) --- CHANGELOG | 1 + plugins/managesieve/lib/Roundcube/rcube_sieve_script.php | 3 ++- plugins/managesieve/tests/src/parser_nesting.out | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 372502da2..2f9524ebf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -17,6 +17,7 @@ CHANGELOG Roundcube Webmail - Fix update of group name in the contacts list header on group rename (#5648) - Add rewrite rule to disable access to /vendor/bin folder in .htaccess (#5630) - Fix bug where it was too easy accidentally move a folder when using the subscription checkbox (#5655) +- Managesieve: Fix parser issue with empty lines between comments (#5657) RELEASE 1.3-beta ---------------- diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php index 5c8c6cfc0..9d1c71445 100644 --- a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php +++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php @@ -592,7 +592,8 @@ class rcube_sieve_script $prefix .= $line . "\n"; } - $position = $endl + 1; + // skip empty lines after the comment (#5657) + $position = self::ltrim_position($script, $endl + 1); } // handle script header diff --git a/plugins/managesieve/tests/src/parser_nesting.out b/plugins/managesieve/tests/src/parser_nesting.out index 5d64332b6..7384f757b 100644 --- a/plugins/managesieve/tests/src/parser_nesting.out +++ b/plugins/managesieve/tests/src/parser_nesting.out @@ -1,5 +1,6 @@ # Sieve Filter # Erzeugt von Ingo (http://www.horde.org/ingo/) (30.09.2016, 16:02) +# Nested rules aren't supported and will be ignored (#5540) # rule:[Ausgeschlossene Adressen] if address :is ["From","Sender","Resent-From"] "noreply@example.org"