Use form posts for transfer jobs
This commit is contained in:
@@ -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']);
|
||||
|
||||
Reference in New Issue
Block a user