From 8d5939348e46697bb5d3f6deff0cd4273db264c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Tue, 13 Dec 2016 10:54:08 +0100 Subject: [PATCH] Use current user in session cache key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes it automatically valid only for current user. Signed-off-by: Michal Čihař --- libraries/Util.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/Util.php b/libraries/Util.php index 7832ec8ab7..f2e67ac819 100644 --- a/libraries/Util.php +++ b/libraries/Util.php @@ -2973,7 +2973,7 @@ class Util */ public static function cacheExists($var) { - return isset($_SESSION['cache']['server_' . $GLOBALS['server']][$var]); + return isset($_SESSION['cache']['server_' . $GLOBALS['server'] . '_' . $GLOBALS['cfg']['Server']['user']][$var]); } /** @@ -2987,7 +2987,7 @@ class Util public static function cacheGet($var, $callback = null) { if (self::cacheExists($var)) { - return $_SESSION['cache']['server_' . $GLOBALS['server']][$var]; + return $_SESSION['cache']['server_' . $GLOBALS['server'] . '_' . $GLOBALS['cfg']['Server']['user']][$var]; } else { if ($callback) { $val = $callback(); @@ -3008,7 +3008,7 @@ class Util */ public static function cacheSet($var, $val = null) { - $_SESSION['cache']['server_' . $GLOBALS['server']][$var] = $val; + $_SESSION['cache']['server_' . $GLOBALS['server'] . '_' . $GLOBALS['cfg']['Server']['user']][$var] = $val; } /** @@ -3020,7 +3020,7 @@ class Util */ public static function cacheUnset($var) { - unset($_SESSION['cache']['server_' . $GLOBALS['server']][$var]); + unset($_SESSION['cache']['server_' . $GLOBALS['server'] . '_' . $GLOBALS['cfg']['Server']['user']][$var]); } /**