Skip to content

Commit

Permalink
Fix an "strpos(): Empty needle" warning
Browse files Browse the repository at this point in the history
Signed-off-by: Cyrille TOULET <cyrille.toulet@linux.com>
  • Loading branch information
Cyrille TOULET committed Mar 27, 2015
1 parent 7abc08a commit 32e7ba3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions system/core/URI.php
Expand Up @@ -205,11 +205,11 @@ protected function _parse_request_uri()
$query = isset($uri['query']) ? $uri['query'] : '';
$uri = isset($uri['path']) ? $uri['path'] : '';

if (strpos($uri, $_SERVER['SCRIPT_NAME']) === 0)
if (!empty($_SERVER['SCRIPT_NAME']) && strpos($uri, $_SERVER['SCRIPT_NAME']) === 0)
{
$uri = (string) substr($uri, strlen($_SERVER['SCRIPT_NAME']));
}
elseif (strpos($uri, dirname($_SERVER['SCRIPT_NAME'])) === 0)
elseif (!empty($_SERVER['SCRIPT_NAME']) && strpos($uri, dirname($_SERVER['SCRIPT_NAME'])) === 0)
{
$uri = (string) substr($uri, strlen(dirname($_SERVER['SCRIPT_NAME'])));
}
Expand Down

0 comments on commit 32e7ba3

Please sign in to comment.