diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index b1231eb..4e197e4 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -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 --------------------------- diff --git a/models/File.php b/models/File.php index 05d9735..899e99c 100644 --- a/models/File.php +++ b/models/File.php @@ -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); } /**