diff options
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -915,9 +915,14 @@ class App { if ((x($_SERVER, 'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'], 0, 2) === "q=") { self::$query_string = str_replace(['<', '>'], ['<', '>'], substr($_SERVER['QUERY_STRING'], 2)); + // removing trailing / - maybe a nginx problem if (substr(self::$query_string, 0, 1) == "/") self::$query_string = substr(self::$query_string, 1); + + // trim trailing '&' if no extra args are present + self::$query_string = rtrim(self::$query_string, '&'); + // change the first & to ? self::$query_string = preg_replace('/&/', '?', self::$query_string, 1); } |