Use form posts for transfer jobs

This commit is contained in:
Mikei386
2026-06-23 07:51:38 +02:00
parent 7cddfb19a4
commit 548c752748
7 changed files with 36 additions and 6 deletions
@@ -107,6 +107,13 @@ function unav_request_json(): array {
return $data;
}
function unav_request_data(): array {
if (!empty($_POST)) {
return $_POST;
}
return unav_request_json();
}
function unav_copy_recursive(string $source, string $destination): void {
if (is_link($source)) {
unav_error(400, 'Copying symlinks is not allowed');
@@ -12,7 +12,7 @@ if (!in_array($action, ['move', 'copy'], true)) {
unav_error(404, 'Unknown job action');
}
$data = unav_request_json();
$data = unav_request_data();
$source = unav_existing_path($data['source'] ?? null);
$destination = unav_destination_path($data['destination'] ?? null);
unav_guard_destination($source['path'], $destination['path']);