From dcdfb6cdc7e4e5308330d420dd15bdd10318127b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 2 Sep 2022 09:16:31 +0200 Subject: [PATCH] Accept WebP payloads in ImageProxyAction --- wcfsetup/install/files/images/proxy/.htaccess | 2 +- wcfsetup/install/files/lib/action/ImageProxyAction.class.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/images/proxy/.htaccess b/wcfsetup/install/files/images/proxy/.htaccess index 51fb39d1df..02fed3c5bc 100644 --- a/wcfsetup/install/files/images/proxy/.htaccess +++ b/wcfsetup/install/files/images/proxy/.htaccess @@ -1,4 +1,4 @@ Require all denied - + Require all granted diff --git a/wcfsetup/install/files/lib/action/ImageProxyAction.class.php b/wcfsetup/install/files/lib/action/ImageProxyAction.class.php index 9d9e8b9959..4b6b13bc67 100644 --- a/wcfsetup/install/files/lib/action/ImageProxyAction.class.php +++ b/wcfsetup/install/files/lib/action/ImageProxyAction.class.php @@ -103,7 +103,7 @@ class ImageProxyAction extends AbstractAction // check whether we already downloaded the image $fileLocation = null; - foreach (['png', 'jpg', 'gif'] as $extension) { + foreach (['png', 'jpg', 'gif', 'webp'] as $extension) { if (\is_file($dir . '/' . $fileName . '.' . $extension)) { $fileLocation = $dir . '/' . $fileName . '.' . $extension; break; @@ -185,6 +185,9 @@ class ImageProxyAction extends AbstractAction case \IMAGETYPE_JPEG: $extension = 'jpg'; break; + case \IMAGETYPE_WEBP: + $extension = 'webp'; + break; default: throw new \DomainException(); } -- 2.20.1