summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
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";
}