diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-09-04 06:52:24 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-09-04 06:52:24 +0000 |
| commit | deb87bcc236481818c66272e8bd7b57bdbe74f93 (patch) | |
| tree | 1b78de5316aa3babf19089420a5c9941193409b9 /plugins/managesieve/lib | |
| parent | efe8de0b5b3dcc305cb8b353fd4dce8913052005 (diff) | |
- Fixed import from Horde-INGO (#1488064)
git-svn-id: https://svn.roundcube.net/trunk@5156 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/managesieve/lib')
| -rw-r--r-- | plugins/managesieve/lib/rcube_sieve.php | 10 |
1 files changed, 6 insertions, 4 deletions
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"; } |
