From e60b73fab9d3933f6001dfea41f83c2223c3da11 Mon Sep 17 00:00:00 2001 From: Rouslan Placella Date: Wed, 4 Apr 2012 20:04:19 +0100 Subject: [PATCH] Fixed broken redirect due to globals removal on expired session --- index.php | 2 +- libraries/auth/cookie.auth.lib.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 2b9346831e..16f1a73e8c 100644 --- a/index.php +++ b/index.php @@ -59,7 +59,7 @@ if (! strlen($GLOBALS['db'])) { $url_query = PMA_generate_common_url($_GET); -if (isset($_REQUEST['target']) && is_string($_REQUEST['target']) && !empty($_REQUEST['target']) && in_array($_REQUEST['target'], $goto_whitelist)) { +if (! empty($_REQUEST['target']) && is_string($_REQUEST['target']) && in_array($_REQUEST['target'], $goto_whitelist)) { $main_target = $_REQUEST['target']; } diff --git a/libraries/auth/cookie.auth.lib.php b/libraries/auth/cookie.auth.lib.php index b9f7536963..87b7548a14 100644 --- a/libraries/auth/cookie.auth.lib.php +++ b/libraries/auth/cookie.auth.lib.php @@ -11,6 +11,14 @@ if (! defined('PHPMYADMIN')) { exit; } +/** + * Remember where to redirect the user + * in case of an expired session. + */ +if (! empty($_REQUEST['target'])) { + $GLOBALS['target'] = $_REQUEST['target']; +} + /** * Swekey authentication functions. */