diff --git a/src/system/modules/metamodelsattribute_file/MetaModelAttributeFile.php b/src/system/modules/metamodelsattribute_file/MetaModelAttributeFile.php index 77f7a24..607cc3b 100644 --- a/src/system/modules/metamodelsattribute_file/MetaModelAttributeFile.php +++ b/src/system/modules/metamodelsattribute_file/MetaModelAttributeFile.php @@ -78,6 +78,13 @@ protected function parseMetaFile($strPath) } $this->arrProcessed[] = $strPath; } + + public function getDownloadLink($strFile) { + $strRequest = Environment::getInstance()->request; + $strRequest .= strpos($strRequest, '?') === false ? '?' : '&'; + $strRequest .= 'file=' . urlencode($strFile); + return $strRequest; + } protected function renderFile($strFile, $objSettings, $strId) { @@ -127,8 +134,7 @@ protected function renderFile($strFile, $objSettings, $strId) 'icon' => $strIcon, 'size' => $objFile->filesize, 'sizetext' => sprintf('(%s)', MetaModelController::getReadableSize($objFile->filesize, 2)), - 'url' => Environment::getInstance()->request . (($GLOBALS['TL_CONFIG']['disableAlias'] || !$GLOBALS['TL_CONFIG']['rewriteURL'] -&& count($_GET) || strlen($_GET['page'])) ? '&' : '?'). 'file=' . MetaModelController::urlEncode($strFile) + 'url' => specialchars($this->getDownloadLink($strFile)) ); // images @@ -346,4 +352,4 @@ protected function prepareTemplate(MetaModelTemplate $objTemplate, $arrRowData, $this->arrSource = array(); } -} \ No newline at end of file +}