REGEX_FOLDER_NAME updated (closes #39)

This commit is contained in:
Ryan
2025-05-26 18:14:08 -04:00
committed by GitHub
parent 16ccb66d55
commit aee78c9750
3 changed files with 13 additions and 1 deletions

View File

@@ -96,12 +96,14 @@ class FolderController
// Basic sanitation for folderName.
if (!preg_match(REGEX_FOLDER_NAME, $folderName)) {
http_response_code(400);
echo json_encode(['error' => 'Invalid folder name.']);
exit;
}
// Optionally sanitize the parent.
if ($parent && !preg_match(REGEX_FOLDER_NAME, $parent)) {
http_response_code(400);
echo json_encode(['error' => 'Invalid parent folder name.']);
exit;
}