Use `Header::normalize()` in `ImageUtil::browserSupportsWebp()`
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 11 May 2022 10:50:10 +0000 (12:50 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 12 May 2022 08:43:14 +0000 (10:43 +0200)
see #4534

wcfsetup/install/files/lib/util/ImageUtil.class.php

index 4749d88382dfa0b7b021835e082bc62616cbb325..b5095de55b5a2632816e40de9fc3625cf6d7b8f2 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace wcf\util;
 
+use GuzzleHttp\Psr7\Header;
 use wcf\system\exception\SystemException;
 use wcf\system\image\ImageHandler;
 
@@ -215,7 +216,7 @@ final class ImageUtil
                     [$mimeType] = ArrayUtil::trim(\explode(";", $acceptableMimeType), false);
 
                     return $mimeType;
-                }, \explode(",", $_SERVER["HTTP_ACCEPT"]));
+                }, Header::normalize($_SERVER["HTTP_ACCEPT"]));
 
                 if (\in_array("image/webp", $acceptableMimeTypes)) {
                     $supportsWebP = true;