diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-02-01 10:06:53 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-02-01 10:06:53 +0000 |
| commit | 2fda79ff797e5e10270e4c85a846bb1dbe27b982 (patch) | |
| tree | 2988fd8dbcdd0710e209f162fff8ef0178c45956 | |
| parent | f70b54c3e3290b4cf1e7297d5537dcb2c2929e4f (diff) | |
- Make managesieve_disabled_extensions to be case insensitive, small CS fixes
git-svn-id: https://svn.roundcube.net/trunk@4478 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | plugins/managesieve/Changelog | 2 | ||||
| -rw-r--r-- | plugins/managesieve/lib/rcube_sieve.php | 25 | ||||
| -rw-r--r-- | plugins/managesieve/managesieve.php | 2 |
3 files changed, 18 insertions, 11 deletions
diff --git a/plugins/managesieve/Changelog b/plugins/managesieve/Changelog index c2350de28..582eb0353 100644 --- a/plugins/managesieve/Changelog +++ b/plugins/managesieve/Changelog @@ -1,3 +1,5 @@ +* version 3.0 [2011-02-01] +----------------------------------------------------------- - Added support for SASL proxy authentication (#1486691) - Fixed parsing of scripts with \r\n line separator - Apply forgotten changes for form errors handling diff --git a/plugins/managesieve/lib/rcube_sieve.php b/plugins/managesieve/lib/rcube_sieve.php index 4fde86a53..1f0b21bb6 100644 --- a/plugins/managesieve/lib/rcube_sieve.php +++ b/plugins/managesieve/lib/rcube_sieve.php @@ -1,6 +1,6 @@ <?php -/* +/** Classes for managesieve operations (using PEAR::Net_Sieve) Author: Aleksander Machniak <alec@alec.pl> @@ -57,7 +57,7 @@ class rcube_sieve $this->sieve->setDebug(true, array($this, 'debug_handler')); } - if (PEAR::isError($this->sieve->connect($host, $port, NULL, $usetls))) { + if (PEAR::isError($this->sieve->connect($host, $port, null, $usetls))) { return $this->_set_error(SIEVE_ERROR_CONNECTION); } @@ -414,12 +414,17 @@ class rcube_sieve_script * @param string Script's text content * @param array Disabled extensions */ - public function __construct($script, $disabled=NULL) + public function __construct($script, $disabled=null) { - if (!empty($disabled)) - foreach ($disabled as $ext) - if (($idx = array_search($ext, $this->supported)) !== false) + 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->supported)) !== false) { unset($this->supported[$idx]); + } + } + } $this->content = $this->_parse_text($script); } @@ -530,7 +535,7 @@ class rcube_sieve_script } else $tests[$i] .= 'header :' . $test['type']; - + $tests[$i] .= ' ' . self::escape_string($test['arg1']); $tests[$i] .= ' ' . self::escape_string($test['arg2']); break; @@ -679,7 +684,7 @@ class rcube_sieve_script $cond = strtolower(self::tokenize($content, 1)); if ($cond != 'if' && $cond != 'elsif' && $cond != 'else') { - return NULL; + return null; } $disabled = false; @@ -802,7 +807,7 @@ class rcube_sieve_script */ private function _parse_actions($content) { - $result = NULL; + $result = null; while (strlen($content)) { $tokens = self::tokenize($content, true); @@ -1068,7 +1073,7 @@ class rcube_sieve_script } } - return $num === 1 ? (isset($result[0]) ? $result[0] : NULL) : $result; + return $num === 1 ? (isset($result[0]) ? $result[0] : null) : $result; } } diff --git a/plugins/managesieve/managesieve.php b/plugins/managesieve/managesieve.php index 5de839da6..f60957e53 100644 --- a/plugins/managesieve/managesieve.php +++ b/plugins/managesieve/managesieve.php @@ -7,7 +7,7 @@ * It's clickable interface which operates on text scripts and communicates * with server using managesieve protocol. Adds Filters tab in Settings. * - * @version 2.10 + * @version 3.0 * @author Aleksander 'A.L.E.C' Machniak <alec@alec.pl> * * Configuration (see config.inc.php.dist) |
