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. */