diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-10-17 10:50:37 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-10-17 10:50:37 +0000 |
| commit | 39930a480955b7ebe5db7de71fddef8f750b8519 (patch) | |
| tree | 9baa94d5eb4b358ee2b79944c0c7dfe46e8b3e95 /plugins/managesieve/lib | |
| parent | bb06657788d03c605837120a77291ad2c621986d (diff) | |
- Filters - UI redesign: added possibility to move filter to any place using drag&drop
(instead of up/down buttons), added filter sets list object, added more 'loading' messages
- Added option to hide some scripts (managesieve_filename_exceptions)
git-svn-id: https://svn.roundcube.net/trunk@5340 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/managesieve/lib')
| -rw-r--r-- | plugins/managesieve/lib/rcube_sieve_script.php | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/plugins/managesieve/lib/rcube_sieve_script.php b/plugins/managesieve/lib/rcube_sieve_script.php index 8fc0e5545..3c6993dcc 100644 --- a/plugins/managesieve/lib/rcube_sieve_script.php +++ b/plugins/managesieve/lib/rcube_sieve_script.php @@ -187,11 +187,17 @@ class rcube_sieve_script array_push($exts, 'variables'); } foreach ($this->vars as $var) { - $output .= (empty($has_vars) ? '# ' : '') . 'set '; - foreach (array_diff(array_keys($var), array('name', 'value')) as $opt) { - $output .= ":$opt "; + if (empty($has_vars)) { + // 'variables' extension not supported, put vars in comments + $output .= sprintf("# %s %s\n", $var['name'], $var['value']); + } + else { + $output .= 'set '; + foreach (array_diff(array_keys($var), array('name', 'value')) as $opt) { + $output .= ":$opt "; + } + $output .= self::escape_string($var['name']) . ' ' . self::escape_string($var['value']) . ";\n"; } - $output .= self::escape_string($var['name']) . ' ' . self::escape_string($var['value']) . ";\n"; } } @@ -423,7 +429,7 @@ class rcube_sieve_script $rulename = $matches[1]; } // KEP:14 variables - else if (preg_match('/^# set "([^"]+)" "([^"]+)";$/', $line, $matches)) { + else if (preg_match('/^# (EDITOR|EDITOR_VERSION) (.+)$/', $line, $matches)) { $this->set_var($matches[1], $matches[2]); } // Horde-Ingo format |
