From 9d6821556344f3649be084f9bcc3020219a62a6c Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Thu, 8 Dec 2022 08:34:21 +0100 Subject: [PATCH] Apply Magento 1.9.0.0 change --- library/Zend/Controller/Request/Http.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/library/Zend/Controller/Request/Http.php b/library/Zend/Controller/Request/Http.php index e8e645912c..342c8d5b8b 100644 --- a/library/Zend/Controller/Request/Http.php +++ b/library/Zend/Controller/Request/Http.php @@ -390,13 +390,19 @@ public function getEnv($key = null, $default = null) public function setRequestUri($requestUri = null) { if ($requestUri === null) { - if ( + if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { + // IIS with Microsoft Rewrite Module + $requestUri = $_SERVER['HTTP_X_ORIGINAL_URL']; + } elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) { + // IIS with ISAPI_Rewrite + $requestUri = $_SERVER['HTTP_X_REWRITE_URL']; + } elseif ( // IIS7 with URL Rewrite: make sure we get the unencoded url (double slash problem) isset($_SERVER['IIS_WasUrlRewritten']) && $_SERVER['IIS_WasUrlRewritten'] == '1' && isset($_SERVER['UNENCODED_URL']) && $_SERVER['UNENCODED_URL'] != '' - ) { + ) { $requestUri = $_SERVER['UNENCODED_URL']; } elseif (isset($_SERVER['REQUEST_URI'])) { $requestUri = $_SERVER['REQUEST_URI'];