From 9f64e4feacdc8cbbe2dd6711c946cb173c1f8a93 Mon Sep 17 00:00:00 2001 From: alec Date: Sat, 20 Nov 2010 17:59:50 +0000 Subject: - Apply forgotten changes for form errors handling - Fix handling of scripts with CRLF line separator git-svn-id: https://svn.roundcube.net/trunk@4241 208e9e7b-5314-0410-a742-e7e81cd9613c --- plugins/managesieve/lib/rcube_sieve.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/managesieve/lib') diff --git a/plugins/managesieve/lib/rcube_sieve.php b/plugins/managesieve/lib/rcube_sieve.php index cec86a1db..ba43f1093 100644 --- a/plugins/managesieve/lib/rcube_sieve.php +++ b/plugins/managesieve/lib/rcube_sieve.php @@ -344,7 +344,7 @@ class rcube_sieve $name = array(); // Squirrelmail (Avelsieve) - if ($tokens = preg_split('/(#START_SIEVE_RULE.*END_SIEVE_RULE)\n/', $script, -1, PREG_SPLIT_DELIM_CAPTURE)) { + if ($tokens = preg_split('/(#START_SIEVE_RULE.*END_SIEVE_RULE)\r?\n/', $script, -1, PREG_SPLIT_DELIM_CAPTURE)) { foreach($tokens as $token) { if (preg_match('/^#START_SIEVE_RULE.*/', $token, $matches)) { $name[$i] = "unnamed rule ".($i+1); @@ -743,7 +743,7 @@ class rcube_sieve_script if (in_array('vacation', $this->supported)) $patterns[] = '^\s*vacation\s+(.*?[^\\\]);'; - $pattern = '/(' . implode('$)|(', $patterns) . '$)/ms'; + $pattern = '/(' . implode('\s*$)|(', $patterns) . '$\s*)/ms'; // parse actions body if (preg_match_all($pattern, $content, $mm, PREG_SET_ORDER)) { -- cgit v1.2.3