Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/AbstractWebApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', ''));
}
}

Expand Down