Thomas Bruederli
2013-03-25 4034a79beb56756d10157635acfa0a71e75c7017
Check for exact matching session keys before splitting into path segments. Adds backwards-compatibility after commit f0a7159c
1 files modified
26 ■■■■■ changed files
program/lib/Roundcube/rcube_session.php 26 ●●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_session.php
@@ -203,10 +203,15 @@
            if (is_array($a_oldvars)) {
                // remove unset keys on oldvars
                foreach ((array)$this->unsets as $var) {
                    $path = explode('.', $var);
                    $k = array_pop($path);
                    $node = &$this->get_node($path, $a_oldvars);
                    unset($node[$k]);
                    if (isset($a_oldvars[$k])) {
                        unset($a_oldvars[$k]);
                    }
                    else {
                        $path = explode('.', $var);
                        $k = array_pop($path);
                        $node = &$this->get_node($path, $a_oldvars);
                        unset($node[$k]);
                    }
                }
                $newvars = $this->serialize(array_merge(
@@ -413,10 +418,15 @@
        $this->unsets[] = $var;
        $path = explode('.', $var);
        $key = array_pop($path);
        $node = &$this->get_node($path, $_SESSION);
        unset($node[$key]);
        if (isset($_SESSION[$var])) {
            unset($_SESSION[$var])
        }
        else {
            $path = explode('.', $var);
            $key = array_pop($path);
            $node = &$this->get_node($path, $_SESSION);
            unset($node[$key]);
        }
        return true;
    }