From f5c18afccafabb025e31a06e6b1aaf48bd70caec Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Thu, 13 Jun 2024 11:23:48 +0200 Subject: [PATCH] Change `ImageUtil::$imageExtensions` to the constant `ImageUtil::IMAGE_EXTENSIONS` --- wcfsetup/install/files/lib/util/ImageUtil.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/util/ImageUtil.class.php b/wcfsetup/install/files/lib/util/ImageUtil.class.php index 1af819452b..84e27fe222 100644 --- a/wcfsetup/install/files/lib/util/ImageUtil.class.php +++ b/wcfsetup/install/files/lib/util/ImageUtil.class.php @@ -17,9 +17,10 @@ final class ImageUtil { /** * image extensions - * @var array + * + * @var string[] */ - protected static $imageExtensions = ['jpeg', 'jpg', 'png', 'gif', "webp"]; + public const IMAGE_EXTENSIONS = ['jpeg', 'jpg', 'png', 'gif', 'webp']; /** * Checks the content of an image for bad sections, e.g. the use of javascript @@ -66,7 +67,7 @@ final class ImageUtil if (@\getimagesize($location) !== false) { $extension = \pathinfo($filename, \PATHINFO_EXTENSION); - if (\in_array(\mb_strtolower($extension), self::$imageExtensions)) { + if (\in_array(\mb_strtolower($extension), ImageUtil::IMAGE_EXTENSIONS)) { return true; } } elseif ($handleSvgAsValidImage) { -- 2.20.1