Validate uploaded trophy images whether their are an image
authorJoshua Rüsweg <josh@bastelstu.be>
Wed, 6 Feb 2019 12:14:21 +0000 (13:14 +0100)
committerJoshua Rüsweg <josh@bastelstu.be>
Wed, 6 Feb 2019 12:14:21 +0000 (13:14 +0100)
wcfsetup/install/files/lib/system/upload/TrophyImageUploadFileValidationStrategy.class.php

index f8d08c2604261345bf86d0f6813a501804167f8f..599baa946f130f68452bc836fd0d31419e27bf82 100644 (file)
@@ -47,6 +47,11 @@ class TrophyImageUploadFileValidationStrategy implements IUploadFileValidationSt
                        return false; 
                }
                
+               if (!ImageUtil::isImage($uploadFile->getLocation(), $uploadFile->getFilename())) {
+                       $uploadFile->setValidationErrorType('noImage');
+                       return false; 
+               }
+               
                return true;
        }
 }