add folders uploading

This commit is contained in:
Ryan
2025-03-14 18:11:32 -04:00
committed by GitHub
parent 8b1dc6907c
commit ad12ee717f
6 changed files with 246 additions and 87 deletions

View File

@@ -13,7 +13,6 @@ if (!isset($_SESSION['authenticated']) || $_SESSION['authenticated'] !== true) {
}
$folder = isset($_GET['folder']) ? trim($_GET['folder']) : 'root';
// Allow only safe characters in the folder parameter (letters, numbers, underscores, dashes, spaces, and forward slashes).
if ($folder !== 'root' && !preg_match('/^[A-Za-z0-9_\- \/]+$/', $folder)) {
echo json_encode(["error" => "Invalid folder name."]);