From 0608cf343c32e9d7703224d26728aefb44eab1cc Mon Sep 17 00:00:00 2001 From: Hauke Luebbers Date: Fri, 7 Feb 2014 23:51:32 +0100 Subject: [PATCH] Routing routine can cope with question marks The routing routine failed when e.g. a third party added normal "question mark GET parameters" to the URL. With this commit these parameters are removed before the URL parts are seperated. --- system/pip.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/system/pip.php b/system/pip.php index c69195c..014c520 100644 --- a/system/pip.php +++ b/system/pip.php @@ -16,6 +16,9 @@ function pip() // Get our url path and trim the / of the left and the right if($request_url != $script_url) $url = trim(preg_replace('/'. str_replace('/', '\/', str_replace('index.php', '', $script_url)) .'/', '', $request_url, 1), '/'); + // Remove string after possible question mark + if (stripos($url, '?') > 0) $url = substr($url, 0, stripos($url, '?')); + // Split the url into segments $segments = explode('/', $url);