From 9e0a32155142731c736c792eb836e983d3c69474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 15 Jun 2016 11:42:45 +0200 Subject: [PATCH] Canonicalize redirect URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We provide absolute path now to avoid problems with URLs like /phpmyadmin/index.php/. Signed-off-by: Michal Čihař --- libraries/core.lib.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/core.lib.php b/libraries/core.lib.php index 93c3a14a5a..1ee6cef23a 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -498,6 +498,14 @@ function PMA_sendHeaderLocation($uri, $use_refresh = false) return; } + /* + * Avoid relative path redirect problems in case user entered URL + * like /phpmyadmin/index.php/ which some web servers happily accept. + */ + if ($uri[0] == '.') { + $uri = $GLOBALS['PMA_Config']->getCookiePath() . substr($uri, 2); + } + $response = PMA\libraries\Response::getInstance(); if (SID) {