FINALLY ADDING $_GET METHOD
This commit is contained in:
parent
b64dd24aa1
commit
03643fb4af
1 changed files with 25 additions and 6 deletions
|
@ -47,8 +47,27 @@ use pocketmine\math\Vector3;
|
||||||
"Date: Fri, 31 Dec 1999 23:59:59 GMT \r\n" .
|
"Date: Fri, 31 Dec 1999 23:59:59 GMT \r\n" .
|
||||||
"Content-Type: text/html \r\n\r\n";
|
"Content-Type: text/html \r\n\r\n";
|
||||||
$file = ltrim($file, '/');
|
$file = ltrim($file, '/');
|
||||||
|
if(strpos($file, "?")) {
|
||||||
|
$exe = explode("?", $file);
|
||||||
|
$file = $exe[0];
|
||||||
|
$exe = explode("&", $exe[1]);
|
||||||
|
}
|
||||||
|
|
||||||
if(file_exists($this->datapath . $file)) {
|
if(file_exists($this->datapath . $file)) {
|
||||||
if(pathinfo($this->datapath . $file)['extension'] === "php") {
|
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();
|
ob_start();
|
||||||
include $this->datapath . $file ;
|
include $this->datapath . $file ;
|
||||||
$Content = ob_get_contents();
|
$Content = ob_get_contents();
|
||||||
|
|
Loading…
Reference in a new issue