Skip to content
Snippets Groups Projects
Commit 63ca0268 authored by Georg Ringer's avatar Georg Ringer Committed by Benni Mack
Browse files

[BUGFIX] Improve exception output for ImageService

Avoid spamming the log in PHP 7.2 due to get_class(null) if fetching the
image in ImageService->getImage() fails.

Resolves: #83570
Releases: master, 8.7, 7.6
Change-Id: Icc3c78f5b747842cee89d184134ff298b8e04a3a
Reviewed-on: https://review.typo3.org/55376


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
parent 587e83cc
Branches
Tags
No related merge requests found
...@@ -130,7 +130,8 @@ class ImageService implements \TYPO3\CMS\Core\SingletonInterface ...@@ -130,7 +130,8 @@ class ImageService implements \TYPO3\CMS\Core\SingletonInterface
} }
if (!($image instanceof File || $image instanceof FileReference)) { if (!($image instanceof File || $image instanceof FileReference)) {
throw new \UnexpectedValueException('Supplied file object type ' . get_class($image) . ' for ' . $src . ' must be File or FileReference.', 1382687163); $class = is_object($image) ? get_class($image) : 'null';
throw new \UnexpectedValueException('Supplied file object type ' . $class . ' for ' . $src . ' must be File or FileReference.', 1382687163);
} }
return $image; return $image;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment