[FOLLOWUP][BUGFIX] Ensure absolute paths for &eID=dumpFile 89/53789/5
authorHelmut Hummel <typo3@helhum.io>
Wed, 23 Aug 2017 11:01:36 +0000 (13:01 +0200)
committerAlexander Opitz <opitz.alexander@googlemail.com>
Wed, 1 Nov 2017 09:26:24 +0000 (10:26 +0100)
This follow-up patch ensures the link is properly generated when
generating it from a Backend context, e.g., when embedding an image
within CKEditor and when TYPO3 is within a subdirectory.

Change-Id: I9783344c70c8cdfd6660a69dff72b251b2964c16
Resolves: #81486
Releases: master
Reviewed-on: https://review.typo3.org/53789
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
typo3/sysext/core/Classes/Resource/ResourceStorage.php
typo3/sysext/extbase/Classes/Service/ImageService.php

index 2beb1f7..a4dbaba 100644 (file)
@@ -1301,7 +1301,8 @@ class ResourceStorage implements ResourceStorageInterface
                     }
 
                     $queryParameterArray['token'] = GeneralUtility::hmac(implode('|', $queryParameterArray), 'resourceStorageDumpFile');
-                    $publicUrl = PathUtility::getAbsoluteWebPath('index.php') . '?' . http_build_query($queryParameterArray, '', '&', PHP_QUERY_RFC3986);
+                    $publicUrl = GeneralUtility::locationHeaderUrl(PathUtility::getAbsoluteWebPath(PATH_site . 'index.php'));
+                    $publicUrl .= '?' . http_build_query($queryParameterArray, '', '&', PHP_QUERY_RFC3986);
                 }
 
                 // If requested, make the path relative to the current script in order to make it possible
index 51f05dc..5fca650 100644 (file)
@@ -95,11 +95,6 @@ class ImageService implements \TYPO3\CMS\Core\SingletonInterface
             $uriPrefix = GeneralUtility::getIndpEnv('TYPO3_SITE_PATH');
         }
 
-        // Prevent double / when concatenating $uriPrefix and $imageUrl
-        if ($imageUrl[0] === '/') {
-            $uriPrefix = rtrim($uriPrefix, '/');
-        }
-
         if ($absolute) {
             // If full URL has no scheme we add the same scheme as used by the site
             // so we have an absolute URL also usable outside of browser scope (e.g. in an email message)