diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-03-07 14:22:11 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-03-07 14:22:11 +0000 |
| commit | 7ac550ea8914f1d1cb72d6269d92b1d8f2b7eeec (patch) | |
| tree | 9095378fc30173e8a0ea813274a6844a06f02469 /plugins/managesieve/lib/rcube_sieve_script.php | |
| parent | 4ae9a39aabee5816b6321d24e771ddb56d824ab7 (diff) | |
- Fix saving of a script using flags extension on servers with imap4flags support (#1487825)
git-svn-id: https://svn.roundcube.net/trunk@4596 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'plugins/managesieve/lib/rcube_sieve_script.php')
| -rw-r--r-- | plugins/managesieve/lib/rcube_sieve_script.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/managesieve/lib/rcube_sieve_script.php b/plugins/managesieve/lib/rcube_sieve_script.php index 084540b60..48122525c 100644 --- a/plugins/managesieve/lib/rcube_sieve_script.php +++ b/plugins/managesieve/lib/rcube_sieve_script.php @@ -26,13 +26,16 @@ class rcube_sieve_script // TODO: body, notify ); + private $capabilities; + /** * Object constructor * * @param string Script's text content - * @param array Disabled extensions + * @param array List of disabled extensions + * @param array List of capabilities supported by server */ - public function __construct($script, $disabled=null) + public function __construct($script, $disabled=null, $capabilities=null) { if (!empty($disabled)) { // we're working on lower-cased names @@ -44,7 +47,8 @@ class rcube_sieve_script } } - $this->content = $this->_parse_text($script); + $this->capabilities = $capabilities; + $this->content = $this->_parse_text($script); } /** @@ -216,7 +220,7 @@ class rcube_sieve_script case 'addflag': case 'setflag': case 'removeflag': - if (!empty($action['mode']) && strtolower($action['mode']) == 'imap4flags') + if (is_array($this->capabilities) && in_array('imap4flags', $this->capabilities)) array_push($exts, 'imap4flags'); else array_push($exts, 'imapflags'); |
