From a7c51ac2d032e29e9599a6f64849c24eb1f7f94d Mon Sep 17 00:00:00 2001 From: alecpl Date: Mon, 12 Sep 2011 06:44:56 +0000 Subject: - Applied fixes from trunk up to r5202 --- plugins/managesieve/Changelog | 2 ++ plugins/managesieve/lib/rcube_sieve.php | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index 4472ccf21..e35406459 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -1,3 +1,5 @@ +- Fixed import from Horde-INGO (#1488064) + * version 4.3 [2011-07-28] ----------------------------------------------------------- - Fixed handling of error in Net_Sieve::listScripts() diff --git a/plugins/managesieve/lib/rcube_sieve.php b/plugins/managesieve/lib/rcube_sieve.php index 230b44bae..7f989e098 100644 --- a/plugins/managesieve/lib/rcube_sieve.php +++ b/plugins/managesieve/lib/rcube_sieve.php @@ -349,8 +349,9 @@ class rcube_sieve $name = array(); // Squirrelmail (Avelsieve) - 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.*END_SIEVE_RULE)\r?\n/', $script)) { + $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); $content .= "# rule:[".$name[$i]."]\n"; @@ -366,9 +367,10 @@ class rcube_sieve } } // Horde (INGO) - else if ($tokens = preg_split('/(# .+)\r?\n/i', $script, -1, PREG_SPLIT_DELIM_CAPTURE)) { + else if (preg_match('/(# .+)\r?\n/', $script)) { + $tokens = preg_split('/(# .+)\r?\n/', $script, -1, PREG_SPLIT_DELIM_CAPTURE); foreach($tokens as $token) { - if (preg_match('/^# (.+)/i', $token, $matches)) { + if (preg_match('/^# (.+)/', $token, $matches)) { $name[$i] = $matches[1]; $content .= "# rule:[" . $name[$i] . "]\n"; } -- cgit v1.2.3