From 26d60f16956e0dc097d5ff1249d7230bbc1832a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Wed, 6 Feb 2019 13:14:21 +0100 Subject: [PATCH] Validate uploaded trophy images whether their are an image --- .../upload/TrophyImageUploadFileValidationStrategy.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wcfsetup/install/files/lib/system/upload/TrophyImageUploadFileValidationStrategy.class.php b/wcfsetup/install/files/lib/system/upload/TrophyImageUploadFileValidationStrategy.class.php index f8d08c2604..599baa946f 100644 --- a/wcfsetup/install/files/lib/system/upload/TrophyImageUploadFileValidationStrategy.class.php +++ b/wcfsetup/install/files/lib/system/upload/TrophyImageUploadFileValidationStrategy.class.php @@ -47,6 +47,11 @@ class TrophyImageUploadFileValidationStrategy implements IUploadFileValidationSt return false; } + if (!ImageUtil::isImage($uploadFile->getLocation(), $uploadFile->getFilename())) { + $uploadFile->setValidationErrorType('noImage'); + return false; + } + return true; } } -- 2.20.1