mirror of
https://github.com/humhub/humhub.git
synced 2025-03-14 20:19:47 +01:00
Avoid PHP error when trying to download a file without guid in the URL params (#6621)
* Avoid PHP error when trying to download a file without guid in the URL params (return 404 exception instead) * Added CHANGELOG-DEV
This commit is contained in:
parent
edb7ab0a1a
commit
8fd707e1f2
@ -4,6 +4,7 @@ HumHub Changelog
|
||||
1.15.0-beta.3 (Unreleased)
|
||||
-------------------------------
|
||||
- Enh #6619: Add a link to "Module Administration" from Marketplace
|
||||
- Enh #6621: Avoid PHP error when trying to download a file without guid in the URL params (return 404 exception instead)
|
||||
|
||||
1.15.0-beta.2 (October 5, 2023)
|
||||
-------------------------------
|
||||
|
@ -10,15 +10,14 @@ namespace humhub\modules\file\actions;
|
||||
|
||||
use Firebase\JWT\JWT;
|
||||
use Firebase\JWT\Key;
|
||||
use humhub\modules\file\libs\FileHelper;
|
||||
use humhub\modules\file\models\File;
|
||||
use humhub\modules\file\Module;
|
||||
use humhub\modules\user\models\User;
|
||||
use Yii;
|
||||
use yii\helpers\Url;
|
||||
use yii\web\HttpException;
|
||||
use yii\base\Action;
|
||||
use humhub\modules\file\models\File;
|
||||
use humhub\modules\file\libs\FileHelper;
|
||||
use yii\filters\HttpCache;
|
||||
use yii\web\HttpException;
|
||||
|
||||
/**
|
||||
* DownloadAction
|
||||
@ -126,7 +125,7 @@ class DownloadAction extends Action
|
||||
*
|
||||
* @throws HttpException
|
||||
*/
|
||||
protected function loadFile(string $guid, ?string $token = null)
|
||||
protected function loadFile(?string $guid, ?string $token = null)
|
||||
{
|
||||
$file = File::findOne(['guid' => $guid]);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user