Skip to content

Commit

Permalink
fix download url generation
Browse files Browse the repository at this point in the history
  • Loading branch information
backbone87 committed Jan 30, 2013
1 parent 44d0df6 commit dd31e5e
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dd31e5e

Please sign in to comment.