[BUGFIX] Image viewhelper clears $GLOBALS['TSFE'] in backend context
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid / Classes / ViewHelpers / ImageViewHelper.php
index f7f91d5..d8ba0b9 100644 (file)
@@ -124,6 +124,9 @@ class ImageViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractTagBasedV
                $imageInfo = $this->contentObject->getImgResource($src, $setup);
                $GLOBALS['TSFE']->lastImageInfo = $imageInfo;
                if (!is_array($imageInfo)) {
+                       if (TYPO3_MODE === 'BE') {
+                               $this->resetFrontendEnvironment();
+                       }
                        throw new \TYPO3\CMS\Fluid\Core\ViewHelper\Exception('Could not get image resource for "' . htmlspecialchars($src) . '".', 1253191060);
                }
                $imageInfo[3] = \TYPO3\CMS\Core\Utility\GeneralUtility::png_to_gif_by_imagemagick($imageInfo[3]);