From: Matthias Schmidt Date: Wed, 18 Feb 2015 17:27:44 +0000 (+0100) Subject: Add UserAvatar::MIN_AVATAR_SIZE X-Git-Tag: 2.1.0_RC_2~30 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b8eca098f9af199cfc6464c22569a31eae2bdf99;p=GitHub%2FWoltLab%2FWCF.git Add UserAvatar::MIN_AVATAR_SIZE --- diff --git a/wcfsetup/install/files/lib/data/user/avatar/UserAvatar.class.php b/wcfsetup/install/files/lib/data/user/avatar/UserAvatar.class.php index f6fc54dc57..7feddf135a 100644 --- a/wcfsetup/install/files/lib/data/user/avatar/UserAvatar.class.php +++ b/wcfsetup/install/files/lib/data/user/avatar/UserAvatar.class.php @@ -37,6 +37,12 @@ class UserAvatar extends DatabaseObject implements IUserAvatar { */ public static $maxThumbnailSize = 128; + /** + * minimum height and width of an uploaded avatar + * @var integer + */ + const MIN_AVATAR_SIZE = 96; + /** * Returns the physical location of this avatar. * diff --git a/wcfsetup/install/files/lib/system/upload/AvatarUploadFileValidationStrategy.class.php b/wcfsetup/install/files/lib/system/upload/AvatarUploadFileValidationStrategy.class.php index 2afb9df4d4..b551ea441a 100644 --- a/wcfsetup/install/files/lib/system/upload/AvatarUploadFileValidationStrategy.class.php +++ b/wcfsetup/install/files/lib/system/upload/AvatarUploadFileValidationStrategy.class.php @@ -1,5 +1,6 @@ getLocation()); - if ($imageData[0] < 96 || $imageData[1] < 96) { + if ($imageData[0] < UserAvatar::MIN_AVATAR_SIZE || $imageData[1] < UserAvatar::MIN_AVATAR_SIZE) { $uploadFile->setValidationErrorType('tooSmall'); return false; }