summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-09-12 06:44:56 +0000
committeralecpl <alec@alec.pl>2011-09-12 06:44:56 +0000
commita7c51ac2d032e29e9599a6f64849c24eb1f7f94d (patch)
tree3c5aef05651017f9f71bf436abc664eb3d20af6e /plugins
parentd96dc639fce2c2e3d1745dacd64a38dbf2bfd4a5 (diff)
- Applied fixes from trunk up to r5202
Diffstat (limited to 'plugins')
-rw-r--r--plugins/managesieve/Changelog2
-rw-r--r--plugins/managesieve/lib/rcube_sieve.php10
2 files changed, 8 insertions, 4 deletions
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";
}