summaryrefslogtreecommitdiff
path: root/plugins/managesieve/lib/rcube_sieve.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-11-18 14:44:48 +0000
committeralecpl <alec@alec.pl>2011-11-18 14:44:48 +0000
commitc994e0e7cd9f593eb21ff80c7c1ddbeaf2a1b12a (patch)
tree44bf85e3a9f96cd13fb82d263cbf068f317fb21c /plugins/managesieve/lib/rcube_sieve.php
parentbdb649067d8cd5bdfa584a21d0a8664f8f89f2d3 (diff)
- Applied fixes from trunk up to r5451
Diffstat (limited to 'plugins/managesieve/lib/rcube_sieve.php')
-rw-r--r--plugins/managesieve/lib/rcube_sieve.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/managesieve/lib/rcube_sieve.php b/plugins/managesieve/lib/rcube_sieve.php
index 7b7ea6eb6..2ed2e54bf 100644
--- a/plugins/managesieve/lib/rcube_sieve.php
+++ b/plugins/managesieve/lib/rcube_sieve.php
@@ -44,7 +44,6 @@ 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
@@ -89,7 +88,17 @@ class rcube_sieve
}
$this->exts = $this->get_extensions();
- $this->disabled = $disabled;
+
+ // disable features by config
+ if (!empty($disabled)) {
+ // we're working on lower-cased names
+ $disabled = array_map('strtolower', (array) $disabled);
+ foreach ($disabled as $ext) {
+ if (($idx = array_search($ext, $this->exts)) !== false) {
+ unset($this->exts[$idx]);
+ }
+ }
+ }
}
public function __destruct() {
@@ -301,7 +310,7 @@ class rcube_sieve
private function _parse($txt)
{
// parse
- $script = new rcube_sieve_script($txt, $this->disabled, $this->exts);
+ $script = new rcube_sieve_script($txt, $this->exts);
// fix/convert to Roundcube format
if (!empty($script->content)) {