mirror of
https://github.com/sigmasternchen/Wish
synced 2025-03-15 07:28:56 +00:00
php-part is now able to recognize errors
This commit is contained in:
parent
364cddd663
commit
08f732b999
1 changed files with 7 additions and 2 deletions
|
@ -9,8 +9,7 @@
|
|||
exit();
|
||||
}
|
||||
echo json_encode($files);
|
||||
}
|
||||
if (isset($_GET['getStructure'])) {
|
||||
} else if (isset($_GET['getStructure'])) {
|
||||
if (strpos($_GET['dir'], "../") !== false)
|
||||
die("illegal file path");
|
||||
$dir = $_GET['dir'];
|
||||
|
@ -21,7 +20,13 @@
|
|||
$base = "../../../../" . $dir;
|
||||
|
||||
$structure = getStructure($base);
|
||||
//var_dump($structure);
|
||||
echo json_encode($structure);
|
||||
$error = json_last_error();
|
||||
if ($error)
|
||||
echo $error;
|
||||
} else {
|
||||
echo "Unknown Command";
|
||||
}
|
||||
|
||||
function getStructure($base) {
|
||||
|
|
Loading…
Reference in a new issue