From a29d1df86871c163b019669e72d360e04e71c31a Mon Sep 17 00:00:00 2001 From: Neil Blakey-Milner Date: Tue, 18 Oct 2005 09:17:50 +0000 Subject: [PATCH] Retrieve the query string from the 'qs' request variable when it is given, simplifying query string handling and controller actions. --- control.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/control.php b/control.php index 05365ff..607beeb 100644 --- a/control.php +++ b/control.php @@ -49,17 +49,21 @@ if (checkSessionAndRedirect(false)) { } } -// need to strip query string params from action before attempting to retrieve from sitemap -$queryString = ""; -// check for the presence of additional params -if (strstr($_SERVER["QUERY_STRING"], "&")) { - // strip and save the querystring - $queryString = substr($_SERVER["QUERY_STRING"], strpos($_SERVER["QUERY_STRING"], "&")+1, strlen($_SERVER["QUERY_STRING"])); -} else if (strstr($_SERVER["QUERY_STRING"], "?")) { - // strip and save the querystring - $queryString = substr($_SERVER["QUERY_STRING"], strpos($_SERVER["QUERY_STRING"], "?")+1, strlen($_SERVER["QUERY_STRING"])); - // update - $action = substr($_SERVER["QUERY_STRING"], 0, strpos($_SERVER["QUERY_STRING"], "?")); +$queryString = KTUtil::arrayGet($_REQUEST, 'qs', ''); + +if (empty($queryString)) { + // need to strip query string params from action before attempting to retrieve from sitemap + $queryString = ""; + // check for the presence of additional params + if (strstr($_SERVER["QUERY_STRING"], "&")) { + // strip and save the querystring + $queryString = substr($_SERVER["QUERY_STRING"], strpos($_SERVER["QUERY_STRING"], "&")+1, strlen($_SERVER["QUERY_STRING"])); + } else if (strstr($_SERVER["QUERY_STRING"], "?")) { + // strip and save the querystring + $queryString = substr($_SERVER["QUERY_STRING"], strpos($_SERVER["QUERY_STRING"], "?")+1, strlen($_SERVER["QUERY_STRING"])); + // update + $action = substr($_SERVER["QUERY_STRING"], 0, strpos($_SERVER["QUERY_STRING"], "?")); + } } // retrieve the page from the sitemap (checks whether this user has access to the requested page) -- libgit2 0.21.4