From 87a0b01e576d354f23035d4b8db2bffe0f8e380f Mon Sep 17 00:00:00 2001 From: Luca Haid Date: Fri, 24 Oct 2025 10:16:35 +0200 Subject: [PATCH] added file uploads --- application/Preorder/PreorderController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/Preorder/PreorderController.php b/application/Preorder/PreorderController.php index 6466a3be5..087affdc5 100644 --- a/application/Preorder/PreorderController.php +++ b/application/Preorder/PreorderController.php @@ -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,