Skip to content
Snippets Groups Projects
Commit 1d58ab08 authored by Oliver Hader's avatar Oliver Hader Committed by Anja Leichsenring
Browse files

[BUGFIX] Invalid back path of ImageViewHelper in TYPO3 backend

If rendering an image in the TYPO3 backend, the regular case is
to prepend "../" to an URI with the assumption that the original
HTTP request was handled by typo3/backend.php.

For the page module for instance, the request points to
typo3/sysext/cms/layout/db_layout.php, thus the back path way
does not work anymore.

To overcome that behavior the absolute path shall be used
instead by determining TYPO3_SITE_PATH. For the case that
some custom processing relies on "../" this change might
be breaking.

Resolves: #65433
Releases: master, 6.2
Change-Id: I969f6a3bdd000b7efb7607e533d1117c8d363959
Reviewed-on: http://review.typo3.org/37407


Reviewed-by: default avatarFrans Saris <franssaris@gmail.com>
Reviewed-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent 0295db1f
Branches
Tags
No related merge requests found
...@@ -18,6 +18,7 @@ use TYPO3\CMS\Core\Resource\FileInterface; ...@@ -18,6 +18,7 @@ use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Resource\File; use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\FileReference; use TYPO3\CMS\Core\Resource\FileReference;
use TYPO3\CMS\Core\Resource\ProcessedFile; use TYPO3\CMS\Core\Resource\ProcessedFile;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\MathUtility; use TYPO3\CMS\Core\Utility\MathUtility;
/** /**
...@@ -73,7 +74,7 @@ class ImageService implements \TYPO3\CMS\Core\SingletonInterface { ...@@ -73,7 +74,7 @@ class ImageService implements \TYPO3\CMS\Core\SingletonInterface {
} elseif ($this->environmentService->isEnvironmentInFrontendMode()) { } elseif ($this->environmentService->isEnvironmentInFrontendMode()) {
$uriPrefix = $GLOBALS['TSFE']->absRefPrefix; $uriPrefix = $GLOBALS['TSFE']->absRefPrefix;
} else { } else {
$uriPrefix = '../'; $uriPrefix = GeneralUtility::getIndpEnv('TYPO3_SITE_PATH');
} }
return $uriPrefix . $imageUrl; return $uriPrefix . $imageUrl;
......
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