From: Joshua Rüsweg Date: Thu, 31 Jan 2019 14:23:29 +0000 (+0100) Subject: Simplify code X-Git-Tag: 5.2.0_Alpha_1~296^2~14 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=eaf46444427944bf170735d1500c8bd0a126b9f4;p=GitHub%2FWoltLab%2FWCF.git Simplify code See #2825 --- diff --git a/wcfsetup/install/files/lib/action/AJAXFileUploadAction.class.php b/wcfsetup/install/files/lib/action/AJAXFileUploadAction.class.php index 44f5e7080c..98a4070d02 100644 --- a/wcfsetup/install/files/lib/action/AJAXFileUploadAction.class.php +++ b/wcfsetup/install/files/lib/action/AJAXFileUploadAction.class.php @@ -89,10 +89,10 @@ class AJAXFileUploadAction extends AbstractSecureAction { foreach ($_FILES['__files']['tmp_name'] as $id => $tmpName) { if ($field->isImageOnly()) { if (@getimagesize($tmpName) === false) { - if (!($field->svgImagesAllowed() && in_array(FileUtil::getMimeType($tmpName), [ + if (!$field->svgImagesAllowed() || !in_array(FileUtil::getMimeType($tmpName), [ 'image/svg', 'image/svg+xml' - ]))) { + ])) { $response['error'][$i++] = [ 'filename' => $_FILES['__files']['name'][$id], 'errorMessage' => WCF::getLanguage()->get('wcf.upload.error.noImage')