[FOLLOWUP][BUGFIX] Allow file:// links in Element Browser 70/37370/2
authorNicole Cordes <typo3@cordes.co>
Sat, 28 Feb 2015 19:19:43 +0000 (20:19 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 28 Feb 2015 20:54:05 +0000 (21:54 +0100)
This patch allows the use of links with file scheme in typolink().

Releases: master, 6.2
Resolves: #65358
Change-Id: I25a8ca88637d1ecab4881127cf2228214b6c954a
Reviewed-on: http://review.typo3.org/37370
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Göran Bodenschatz <coding@46halbe.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index 259645a..25fa9ab 100644 (file)
@@ -18,6 +18,7 @@ use TYPO3\CMS\Core\Imaging\GraphicalFunctions;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
 use TYPO3\CMS\Core\Utility\ArrayUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Utility\StringUtility;
 use TYPO3\CMS\Core\Versioning\VersionState;
 use TYPO3\CMS\Frontend\ContentObject\Exception\ContentRenderingException;
 use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
@@ -5906,7 +5907,7 @@ class ContentObjectRenderer {
                }
 
                // Resolve FAL-api "file:UID-of-sys_file-record" and "file:combined-identifier"
-               if ($linkHandlerKeyword === 'file') {
+               if ($linkHandlerKeyword === 'file' && !StringUtility::beginsWith($linkParameterParts[0], 'file://')) {
                        try {
                                $fileOrFolderObject = $this->getResourceFactory()->retrieveFileOrFolderObject($linkHandlerValue);
                                // Link to a folder or file