diff --git a/src/Symfony/Component/HttpFoundation/ApacheRequest.php b/src/Symfony/Component/HttpFoundation/ApacheRequest.php index a060d628f0ba4..c0a3a94e0c907 100644 --- a/src/Symfony/Component/HttpFoundation/ApacheRequest.php +++ b/src/Symfony/Component/HttpFoundation/ApacheRequest.php @@ -27,7 +27,7 @@ class ApacheRequest extends Request */ protected function prepareRequestUri() { - return $this->server->get('REQUEST_URI'); + return $this->server->get('REQUEST_URI', '/'); } /** @@ -37,7 +37,7 @@ protected function prepareBaseUrl() { $baseUrl = $this->server->get('SCRIPT_NAME'); - if (!str_contains($this->server->get('REQUEST_URI'), $baseUrl)) { + if (!str_contains($this->server->get('REQUEST_URI', '/'), $baseUrl)) { // assume mod_rewrite return rtrim(\dirname($baseUrl), '/\\'); } diff --git a/src/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php index 7a5bd378a200c..9682bf590042e 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php @@ -89,6 +89,14 @@ public function provideServerVars() '', '/', ], + [ + [ + 'SCRIPT_NAME' => '/app_dev.php', + ], + '/', + '', + '/', + ], ]; } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy