From c3ebf8b995927b826072cfcc72d08a9ebd93f878 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 18 Aug 2021 18:37:11 +0200 Subject: [PATCH] Skip cover photos that cannot be read --- .../lib/data/user/cover/photo/UserCoverPhoto.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/lib/data/user/cover/photo/UserCoverPhoto.class.php b/wcfsetup/install/files/lib/data/user/cover/photo/UserCoverPhoto.class.php index 30c68c9d75..eaf521380b 100644 --- a/wcfsetup/install/files/lib/data/user/cover/photo/UserCoverPhoto.class.php +++ b/wcfsetup/install/files/lib/data/user/cover/photo/UserCoverPhoto.class.php @@ -114,7 +114,11 @@ class UserCoverPhoto implements IWebpUserCoverPhoto return; } - $sourceLocation = WCF_DIR . 'images/coverPhotos/' . $this->getFilename($this->coverPhotoExtension === 'webp'); + $sourceLocation = $this->getLocation($this->coverPhotoExtension === 'webp'); + if (!\is_readable($sourceLocation)) { + return; + } + $outputFilenameWithoutExtension = \preg_replace('~\.[a-z]+$~', '', $sourceLocation); return ImageUtil::createWebpVariant($sourceLocation, $outputFilenameWithoutExtension); -- 2.20.1