From 13dec5ad70192080bbe09e45988093e8fc60ffa9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 21 Jul 2020 12:04:34 +0200 Subject: [PATCH] Process deletions before uploads in StyleAddForm --- .../install/files/lib/acp/form/StyleAddForm.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php index 424489e5e2..b6a550bf9d 100644 --- a/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php @@ -323,14 +323,15 @@ class StyleAddForm extends AbstractForm { $this->uploads = []; foreach (['image', 'image2x'] as $field) { - $files = UploadHandler::getInstance()->getFilesByFieldId($field); - if (!empty($files)) { - $this->uploads[$field] = $files[0]; - } $removedFiles = UploadHandler::getInstance()->getRemovedFiledByFieldId($field); if (!empty($removedFiles)) { $this->uploads[$field] = null; } + + $files = UploadHandler::getInstance()->getFilesByFieldId($field); + if (!empty($files)) { + $this->uploads[$field] = $files[0]; + } } } -- 2.20.1