[BUGFIX] Download link for absolute file path 68/28168/5
authorMarian Pollzien <marian.pollzien@netresearch.de>
Fri, 7 Mar 2014 16:26:58 +0000 (17:26 +0100)
committerFrans Saris <franssaris@gmail.com>
Wed, 12 Mar 2014 13:18:10 +0000 (14:18 +0100)
Support FAL adapters that return absolute urls as public file url

Change-Id: I68f2675a1a5137e6d0c5cadee7b21e82e8730fdf
Resolves: #56659
Releases: 6.2
Reviewed-on: https://review.typo3.org/28168
Reviewed-by: Wouter Wolters
Reviewed-by: Christian Weiske
Tested-by: Christian Weiske
Reviewed-by: Frans Saris
Tested-by: Frans Saris
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php

index 590b59c..49829fb 100644 (file)
@@ -285,8 +285,10 @@ class ElementInformationController {
                        }
 
                        // Display download link?
-                       if ($this->fileObject->getPublicUrl()) {
-                               $downloadLink .= '<a href="../' . $this->fileObject->getPublicUrl() . '" target="_blank" class="t3-button">' .
+                       $url = $this->fileObject->getPublicUrl(TRUE);
+
+                       if ($url) {
+                               $downloadLink .= '<a href="' . htmlspecialchars($url) . '" target="_blank" class="t3-button">' .
                                                IconUtility::getSpriteIcon('actions-edit-download') . ' ' .
                                                $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:download', TRUE) .
                                                '</a>';