Merge branch 'Preorder/add-files' into 'master'

added file uploads

See merge request fronk/thetool!1857
This commit is contained in:
Luca Haid
2025-10-24 08:16:44 +00:00

View File

@@ -2008,6 +2008,11 @@ class PreorderController extends mfBaseController {
foreach ($_FILES['files']['name'] as $index => $name) {
if ($_FILES['files']['error'][$index] !== UPLOAD_ERR_OK) continue;
$extension = pathinfo($name, PATHINFO_EXTENSION);
$name = preg_replace('/[^a-zA-Z0-9_-]/', '_', substr($descriptions[$index], 0, 50));
if ($extension) {
$name .= '.' . $extension;
}
$_FILES['file'] = [
'name' => $name,