Aleksander Machniak
2015-02-26 b59b72cc3028cc0514e951f135d8bfe7efcaaa6f
plugins/managesieve/lib/Roundcube/rcube_sieve_engine.php
@@ -220,7 +220,7 @@
     *
     * @return int Connection status: 0 on success, >0 on failure
     */
    public function load_script($script_name = null)
    protected function load_script($script_name = null)
    {
        // Get list of scripts
        $list = $this->list_scripts();
@@ -390,10 +390,11 @@
            }
            else if ($action == 'setget') {
                $script_name = rcube_utils::get_input_value('_set', rcube_utils::INPUT_GPC, true);
                $script = $this->sieve->get_script($script_name);
                $script      = $this->sieve->get_script($script_name);
                if (PEAR::isError($script))
                if (is_a($script, 'PEAR_Error')) {
                    exit;
                }
                $browser = new rcube_browser;
@@ -2105,7 +2106,10 @@
                    foreach ($rules['actions'] as $action) {
                        if ($action['type'] == 'include' && empty($action['global'])) {
                            $name = preg_replace($filename_regex, '', $action['target']);
                            $this->active[] = $name;
                            // make sure the script exist
                            if (in_array($name, $this->list)) {
                                $this->active[] = $name;
                            }
                        }
                    }
                }
@@ -2341,12 +2345,12 @@
     */
    protected function init_script()
    {
        $this->script = $this->sieve->script->as_array();
        if (!$this->script) {
        if (!$this->sieve->script) {
            return;
        }
        $this->script = $this->sieve->script->as_array();
        $headers    = array();
        $exceptions = array('date', 'currentdate', 'size', 'body');