From 32e7ba3560a2c2c3a72236463091049c51a518ec Mon Sep 17 00:00:00 2001 From: Cyrille TOULET Date: Fri, 27 Mar 2015 19:28:10 +0100 Subject: Fix an "strpos(): Empty needle" warning Signed-off-by: Cyrille TOULET --- system/core/URI.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/core') diff --git a/system/core/URI.php b/system/core/URI.php index e96749456..43a0a9caa 100644 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -205,11 +205,11 @@ class CI_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']))); } -- cgit v1.2.3-24-g4f1b