Fixing URI on handlers

having the URI with the args of get request
This commit is contained in:
Ad5001 2016-12-28 18:34:58 +01:00
parent 520f4f8115
commit 51ceb0ecc9

View file

@ -15,6 +15,14 @@ $_PLAYERS = $args["PLAYERS"];
$_LEVELS = $args["LEVELS"]; $_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. // Calling handlers.
foreach($args["HANDLERS"] as $handler) { foreach($args["HANDLERS"] as $handler) {
// echo $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. // Getting the file & output it if possible.
if(!file_exists(__DIR__ . "/../" . $uri)) { if(!file_exists(__DIR__ . "/../" . $uri)) {
echo file_get_contents(__DIR__ . "/../" . $host . "/" . $cfg[404]); echo file_get_contents(__DIR__ . "/../" . $host . "/" . $cfg[404]);