diff --git a/src/system/modules/metamodelsattribute_file/MetaModelAttributeFile.php b/src/system/modules/metamodelsattribute_file/MetaModelAttributeFile.php index b69981c..5441b8e 100644 --- a/src/system/modules/metamodelsattribute_file/MetaModelAttributeFile.php +++ b/src/system/modules/metamodelsattribute_file/MetaModelAttributeFile.php @@ -81,6 +81,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) { @@ -131,8 +138,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