From b5fadf80341868594002a86013e0045ac045d4a2 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 13 Dec 2007 18:48:53 +0000 Subject: [PATCH] bug #1817612 [cookies] Wrong cookie path on IIS with PHP-CGI --- ChangeLog | 2 ++ libraries/Config.class.php | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 01e76c2d8..9c61694ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - bug #1843463 [GUI] DROP PROCEDURE does not show alert - bug #1835904 [GUI] Back link after a SQL error forgets the query - bug #1835654 [core] wrong escaping when using double quotes +- bug #1817612 [cookies] Wrong cookie path on IIS with PHP-CGI, + thanks to Carsten Wiedmann 2.11.3.0 (2007-12-08) - patch #1818389 to remove a notice (failed to flush buffer), thanks to diff --git a/libraries/Config.class.php b/libraries/Config.class.php index f5d17a3e1..42284a491 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -861,17 +861,18 @@ class PMA_Config if (empty($url)) { if (PMA_getenv('PATH_INFO')) { $url = PMA_getenv('PATH_INFO'); + // on IIS with PHP-CGI: + } elseif (PMA_getenv('SCRIPT_NAME')) { + $url = PMA_getenv('SCRIPT_NAME'); } elseif (PMA_getenv('PHP_SELF')) { // PHP_SELF in CGI often points to cgi executable, so use it // as last choice $url = PMA_getenv('PHP_SELF'); - } elseif (PMA_getenv('SCRIPT_NAME')) { - $url = PMA_getenv('PHP_SELF'); } } $parsed_url = @parse_url($_SERVER['REQUEST_URI']); // produces E_WARNING if it cannot get parsed, e.g. '/foobar:/' - if ($parsed_url === false) { + if ($parsed_url === false || empty($parsed_url['path'])) { $parsed_url = array('path' => $url); }