summaryrefslogtreecommitdiff
path: root/mail/roundcube/files/patch-program_lib_Roundcube_rcube_session.php
blob: 97208eb71e35cb757385fec98aeb7c65e29fecd8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
--- program/lib/Roundcube/rcube_session.php.orig	2016-05-22 11:06:47 UTC
+++ program/lib/Roundcube/rcube_session.php
@@ -39,7 +39,6 @@ abstract class rcube_session
     protected $time_diff    = 0;
     protected $reloaded     = false;
     protected $appends      = array();
-    protected $unsets       = array();
     protected $gc_enabled   = 0;
     protected $gc_handlers  = array();
     protected $cookiename   = 'roundcube_sessauth';
@@ -158,7 +157,7 @@ abstract class rcube_session
 
         // if there are cached vars, update store, else insert new data
         if ($oldvars) {
-            $newvars = $this->_fixvars($vars, $oldvars);
+            $newvars = $vars);
             return $this->update($key, $newvars, $oldvars);
         }
         else {
@@ -180,39 +179,6 @@ abstract class rcube_session
     }
 
     /**
-     * Merge vars with old vars and apply unsets
-     */
-    protected function _fixvars($vars, $oldvars)
-    {
-        if ($oldvars !== null) {
-            $a_oldvars = $this->unserialize($oldvars);
-            if (is_array($a_oldvars)) {
-                // remove unset keys on oldvars
-                foreach ((array)$this->unsets as $var) {
-                    if (isset($a_oldvars[$var])) {
-                        unset($a_oldvars[$var]);
-                    }
-                    else {
-                        $path = explode('.', $var);
-                        $k = array_pop($path);
-                        $node = &$this->get_node($path, $a_oldvars);
-                        unset($node[$k]);
-                    }
-                }
-
-                $newvars = $this->serialize(array_merge(
-                    (array)$a_oldvars, (array)$this->unserialize($vars)));
-            }
-            else {
-                $newvars = $vars;
-            }
-        }
-
-        $this->unsets = array();
-        return $newvars;
-    }
-
-    /**
      * Execute registered garbage collector routines
      */
     public function gc($maxlifetime)
@@ -321,11 +287,6 @@ abstract class rcube_session
         }
 
         $this->appends[] = $path;
-
-        // when overwriting a previously unset variable
-        if ($this->unsets[$path]) {
-            unset($this->unsets[$path]);
-        }
     }
 
     /**
@@ -340,8 +301,6 @@ abstract class rcube_session
             return $this->destroy(session_id());
         }
 
-        $this->unsets[] = $var;
-
         if (isset($_SESSION[$var])) {
             unset($_SESSION[$var]);
         }
@@ -387,21 +346,6 @@ abstract class rcube_session
 
         if ($data) {
             session_decode($data);
-
-            // apply appends and unsets to reloaded data
-            $_SESSION = array_merge_recursive($_SESSION, $merge_data);
-
-            foreach ((array)$this->unsets as $var) {
-                if (isset($_SESSION[$var])) {
-                    unset($_SESSION[$var]);
-                }
-                else {
-                    $path = explode('.', $var);
-                    $k = array_pop($path);
-                    $node = &$this->get_node($path, $_SESSION);
-                    unset($node[$k]);
-                }
-            }
         }
     }