fix drag-drop, UI glitches, & update validation

This commit is contained in:
Ryan
2025-04-11 03:21:09 -04:00
committed by GitHub
parent 4360f2830a
commit 337f529afd
36 changed files with 161 additions and 73 deletions

View File

@@ -45,7 +45,7 @@ $sourceFolder = trim($data['source']) ?: 'root';
$destinationFolder = trim($data['destination']) ?: 'root';
// Allow only letters, numbers, underscores, dashes, spaces, and forward slashes in folder names.
$folderPattern = '/^[A-Za-z0-9_\- \/]+$/';
$folderPattern = '/^[\p{L}\p{N}_\-\s\/\\\\]+$/u';
if ($sourceFolder !== 'root' && !preg_match($folderPattern, $sourceFolder)) {
echo json_encode(["error" => "Invalid source folder name."]);
exit;
@@ -111,7 +111,7 @@ $srcMetadata = file_exists($srcMetaFile) ? json_decode(file_get_contents($srcMet
$destMetadata = file_exists($destMetaFile) ? json_decode(file_get_contents($destMetaFile), true) : [];
$errors = [];
$safeFileNamePattern = '/^[A-Za-z0-9_\-\.\(\) ]+$/';
$safeFileNamePattern = '/^[\p{L}\p{N}\p{M}%\-\.\(\) _]+$/u';
foreach ($data['files'] as $fileName) {
// Save the original name for metadata lookup.