diff options
author | Cyrille TOULET <iwa@hestia.nerdit.fr> | 2015-03-27 19:28:10 +0100 |
---|---|---|
committer | Cyrille TOULET <iwa@hestia.nerdit.fr> | 2015-03-27 19:28:10 +0100 |
commit | 32e7ba3560a2c2c3a72236463091049c51a518ec (patch) | |
tree | ef56807fa29f9c74fbc297a65d44e57196346064 /system | |
parent | 7abc08acbeec7437b72d44e5e1a3500f7f6ac766 (diff) |
Fix an "strpos(): Empty needle" warning
Signed-off-by: Cyrille TOULET <cyrille.toulet@linux.com>
Diffstat (limited to 'system')
-rw-r--r-- | system/core/URI.php | 4 |
1 files changed, 2 insertions, 2 deletions
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']))); } |