Skip to content

Commit

Permalink
Merge pull request #204 from humhub/fix/203-downloading-renamed-files
Browse files Browse the repository at this point in the history
Refresh name of a downloading renamed file
  • Loading branch information
luke- authored Jan 30, 2024
2 parents b7ea266 + ed719a5 commit 9141442
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
0.16.4 - Unreleased
---------------------------
- Fix #201: Fix replaced method `friendship\Module::isEnabled()`
- Fix #203: Refresh name of a downloading renamed file

0.16.3 - November 16, 2023
---------------------------
Expand Down
10 changes: 4 additions & 6 deletions models/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,10 @@ public function getFullUrl()
*/
public function getDownloadUrl($forceDownload = false, $scheme = true)
{
if(!$scheme) {
return DownloadFileHandler::getUrl($this->baseFile, $forceDownload);
} else {
// Todo can be removed after v1.2.3 then call DownloadFileHandler::getUrl($this->baseFile, $forceDownload, $scheme)
return Url::to(['/file/file/download', 'guid' => $this->baseFile->guid, 'download' => $forceDownload], $scheme);
}
return $this->baseFile->getUrl([
'download' => $forceDownload,
'hash_name' => substr(sha1($this->baseFile->file_name), 0, 4)
], $scheme);
}

/**
Expand Down

0 comments on commit 9141442

Please sign in to comment.