mirror of
https://github.com/sigmasternchen/Wish
synced 2025-03-15 15:38:54 +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();
|
exit();
|
||||||
}
|
}
|
||||||
echo json_encode($files);
|
echo json_encode($files);
|
||||||
}
|
} else if (isset($_GET['getStructure'])) {
|
||||||
if (isset($_GET['getStructure'])) {
|
|
||||||
if (strpos($_GET['dir'], "../") !== false)
|
if (strpos($_GET['dir'], "../") !== false)
|
||||||
die("illegal file path");
|
die("illegal file path");
|
||||||
$dir = $_GET['dir'];
|
$dir = $_GET['dir'];
|
||||||
|
@ -21,7 +20,13 @@
|
||||||
$base = "../../../../" . $dir;
|
$base = "../../../../" . $dir;
|
||||||
|
|
||||||
$structure = getStructure($base);
|
$structure = getStructure($base);
|
||||||
|
//var_dump($structure);
|
||||||
echo json_encode($structure);
|
echo json_encode($structure);
|
||||||
|
$error = json_last_error();
|
||||||
|
if ($error)
|
||||||
|
echo $error;
|
||||||
|
} else {
|
||||||
|
echo "Unknown Command";
|
||||||
}
|
}
|
||||||
|
|
||||||
function getStructure($base) {
|
function getStructure($base) {
|
||||||
|
|
Loading…
Reference in a new issue