From 7ac550ea8914f1d1cb72d6269d92b1d8f2b7eeec Mon Sep 17 00:00:00 2001 From: alec Date: Mon, 7 Mar 2011 14:22:11 +0000 Subject: - 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 --- plugins/managesieve/lib/rcube_sieve.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'plugins/managesieve/lib/rcube_sieve.php') diff --git a/plugins/managesieve/lib/rcube_sieve.php b/plugins/managesieve/lib/rcube_sieve.php index a51671e88..d701095f2 100644 --- a/plugins/managesieve/lib/rcube_sieve.php +++ b/plugins/managesieve/lib/rcube_sieve.php @@ -31,6 +31,7 @@ class rcube_sieve public $script; // rcube_sieve_script object public $current; // name of currently loaded script private $disabled; // array of disabled extensions + private $exts; // array of supported extensions /** @@ -73,6 +74,7 @@ class rcube_sieve return $this->_set_error(SIEVE_ERROR_LOGIN); } + $this->exts = $this->get_extensions(); $this->disabled = $disabled; } @@ -191,6 +193,9 @@ class rcube_sieve */ public function get_extensions() { + if ($this->exts) + return $this->exts; + if (!$this->sieve) return $this->_set_error(SIEVE_ERROR_INTERNAL); @@ -280,12 +285,12 @@ class rcube_sieve private function _parse($txt) { // try to parse from Roundcube format - $script = new rcube_sieve_script($txt, $this->disabled); + $script = new rcube_sieve_script($txt, $this->disabled, $this->exts); // ... else try to import from different formats if (empty($script->content)) { $script = $this->_import_rules($txt); - $script = new rcube_sieve_script($script, $this->disabled); + $script = new rcube_sieve_script($script, $this->disabled, $this->exts); } // replace all elsif with if+stop, we support only ifs -- cgit v1.2.3