FINALLY ADDING $_GET METHOD

This commit is contained in:
Ad5001 2016-05-31 18:46:19 +02:00
parent b64dd24aa1
commit 03643fb4af

View file

@ -47,8 +47,27 @@ use pocketmine\math\Vector3;
"Date: Fri, 31 Dec 1999 23:59:59 GMT \r\n" .
"Content-Type: text/html \r\n\r\n";
$file = ltrim($file, '/');
if(strpos($file, "?")) {
$exe = explode("?", $file);
$file = $exe[0];
$exe = explode("&", $exe[1]);
}
if(file_exists($this->datapath . $file)) {
if(pathinfo($this->datapath . $file)['extension'] === "php") {
if(isset($exe[0])) {
$GET = [];
foreach($exe as $exes) {
$ex = explode("=", $exes);
array_push($GET, "\"{$ex[0]}\" => \"{$ex[1]}\"");
}
$current = '<?php
$GET = [' . implode("," . PHP_EOL, $GET) . '];
?>' . file_get_contents($this->datapath . $file);
$current = str_ireplace('$_GET', '$GET', $current);
file_put_contents($this->datapath . "current.php", $current);
$file = "current.php";
}
ob_start();
include $this->datapath . $file ;
$Content = ob_get_contents();