From 51ceb0ecc9e1eedfac1a7662df07fb9325c6ea0a Mon Sep 17 00:00:00 2001 From: Ad5001 Date: Wed, 28 Dec 2016 18:34:58 +0100 Subject: [PATCH] Fixing URI on handlers having the URI with the args of get request --- resources/handler.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/resources/handler.php b/resources/handler.php index 082e69c..0bcb98e 100644 --- a/resources/handler.php +++ b/resources/handler.php @@ -15,6 +15,14 @@ $_PLAYERS = $args["PLAYERS"]; $_LEVELS = $args["LEVELS"]; +// Removing GET from the request +$uri = $_SERVER["REQUEST_URI"]; +if(strpos($uri, "?") !== false) { + $uri = explode("?", $uri)[0]; +} +$_SERVER["REQUEST_URI"] = $uri; + + // Calling handlers. foreach($args["HANDLERS"] as $handler) { // echo $handler; @@ -37,13 +45,6 @@ if(in_array($host, $cfg["Domains"])) { } -// Removing GET from the request -$uri = $_SERVER["REQUEST_URI"]; -if(strpos($uri, "?") !== false) { - $uri = explode("?", $uri)[0]; -} - - // Getting the file & output it if possible. if(!file_exists(__DIR__ . "/../" . $uri)) { echo file_get_contents(__DIR__ . "/../" . $host . "/" . $cfg[404]);