From 4428c6105cab95cf112f238f06a099d3d9666c64 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Fri, 17 Jul 2015 09:54:22 +0100 Subject: [PATCH] Use Input to retrieve $_SERVER information --- src/AbstractWebApplication.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/AbstractWebApplication.php b/src/AbstractWebApplication.php index 36231075..d84be2dd 100644 --- a/src/AbstractWebApplication.php +++ b/src/AbstractWebApplication.php @@ -705,16 +705,18 @@ protected function loadSystemUris($requestUri = null) // Start with the requested URI. $uri = new Uri($this->get('uri.request')); + $requestUri = $this->input->server->getString('REQUEST_URI', ''); + // If we are working from a CGI SAPI with the 'cgi.fix_pathinfo' directive disabled we use PHP_SELF. - if (strpos(php_sapi_name(), 'cgi') !== false && !ini_get('cgi.fix_pathinfo') && !empty($_SERVER['REQUEST_URI'])) + if (strpos(php_sapi_name(), 'cgi') !== false && !ini_get('cgi.fix_pathinfo') && !empty($requestUri)) { // We aren't expecting PATH_INFO within PHP_SELF so this should work. - $path = dirname($_SERVER['PHP_SELF']); + $path = dirname($this->input->server->getString('PHP_SELF', '')); } else // Pretty much everything else should be handled with SCRIPT_NAME. { - $path = dirname($_SERVER['SCRIPT_NAME']); + $path = dirname($this->input->server->getString('SCRIPT_NAME', '')); } }