Skip to content
Snippets Groups Projects
Commit 4ecb81cf authored by Franz Koch's avatar Franz Koch Committed by Markus Klein
Browse files

[BUGFIX] Don't prepend absolute image URLs

The ImageService->getImageUri() method always prepends the public URL of
the image object with a prefix, regardless whether the object already
returns a fully qualified URL. This can be the case when the FAL driver
is connecting a remote image storage that doesn't allow local processing
and requires the images to be loaded from the remote server.

Change-Id: Iac65bc93bc0d1c1cbeb2335b7e13fc2126b728b6
Resolves: #61617
Releases: 6.2, 6.3
Reviewed-on: http://review.typo3.org/32786


Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarFranz Koch <typo3@elements-net.de>
Reviewed-by: default avatarAlexander Opitz <opitz.alexander@googlemail.com>
Tested-by: default avatarAlexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: default avatarStefan Froemken <froemken@gmail.com>
Reviewed-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Tested-by: default avatarMarkus Klein <klein.t3@reelworx.at>
parent 70d736c5
Branches
Tags
No related merge requests found
......@@ -65,13 +65,18 @@ class ImageService implements \TYPO3\CMS\Core\SingletonInterface {
* @api
*/
public function getImageUri(FileInterface $image) {
if ($this->environmentService->isEnvironmentInFrontendMode()) {
$imageUrl = $image->getPublicUrl();
// no prefix in case of an already fully qualified URL (having a schema)
if (strpos($imageUrl, '://')) {
$uriPrefix = '';
} elseif ($this->environmentService->isEnvironmentInFrontendMode()) {
$uriPrefix = $GLOBALS['TSFE']->absRefPrefix;
} else {
$uriPrefix = '../';
}
return $uriPrefix . $image->getPublicUrl();
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