Skip to content

Commit

Permalink
Merge pull request #2810 from willnode/patch-1
Browse files Browse the repository at this point in the history
Ensure $_SERVER['SCRIPT_NAME'] ends with PHP
  • Loading branch information
lonnieezell authored Apr 7, 2020
2 parents c3e545d + edbd927 commit 7179fcc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/HTTP/IncomingRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ protected function parseRequestURI(): string
$query = $parts['query'] ?? '';
$uri = $parts['path'] ?? '';

if (isset($_SERVER['SCRIPT_NAME'][0]))
if (isset($_SERVER['SCRIPT_NAME'][0]) && pathinfo($_SERVER['SCRIPT_NAME'], PATHINFO_EXTENSION) === 'php')
{
// strip the script name from the beginning of the URI
if (strpos($uri, $_SERVER['SCRIPT_NAME']) === 0)
Expand Down

0 comments on commit 7179fcc

Please sign in to comment.