summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2013-03-25 09:05:26 +0100
committerThomas Bruederli <thomas@roundcube.net>2013-03-25 09:05:26 +0100
commit4034a79beb56756d10157635acfa0a71e75c7017 (patch)
tree928ff846a944871ae6f00b4086b4a0d957f8a567
parent38c1951266b1fda074340be4a8eb840a60f9ac11 (diff)
Check for exact matching session keys before splitting into path segments. Adds backwards-compatibility after commit f0a7159c
-rw-r--r--program/lib/Roundcube/rcube_session.php26
1 files changed, 18 insertions, 8 deletions
diff --git a/program/lib/Roundcube/rcube_session.php b/program/lib/Roundcube/rcube_session.php
index 82ff8a804..4282c0cbb 100644
--- a/program/lib/Roundcube/rcube_session.php
+++ b/program/lib/Roundcube/rcube_session.php
@@ -203,10 +203,15 @@ class rcube_session
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 @@ class rcube_session
$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;
}