Prevent deletion of system files
This commit is contained in:
@ -5,6 +5,11 @@ require_once __DIR__ . '/../vfs.php';
|
||||
$data = json_decode(file_get_contents('php://input'), true);
|
||||
$pathV = $data['path'] ?? '';
|
||||
|
||||
if (strpos($pathV, '/.apps') === 0 || $pathV === '/.thos_state.json') {
|
||||
echo json_encode(['success'=>false, 'error'=>'Cannot delete system files']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$real = resolve_path($pathV);
|
||||
if (!file_exists($real)) {
|
||||
echo json_encode(['success'=>false,'error'=>'Not found']);
|
||||
|
Reference in New Issue
Block a user