From 04ed3846d3135e1a8c023157811465f424108312 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 20db6bff2..bfac915f9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -20,6 +20,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.2.3 ------------- diff --git a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php index 9af5bf76e..ce3297467 100644 --- a/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php +++ b/plugins/managesieve/lib/Roundcube/rcube_sieve_script.php @@ -562,7 +562,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"