From: Joshua Rüsweg Date: Wed, 6 Feb 2019 12:14:21 +0000 (+0100) Subject: Validate uploaded trophy images whether their are an image X-Git-Tag: 3.1.8~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=26d60f16956e0dc097d5ff1249d7230bbc1832a4;p=GitHub%2FWoltLab%2FWCF.git Validate uploaded trophy images whether their are an image --- 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; } }