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:
Marc Farré 2023-10-19 11:37:01 +02:00 committed by GitHub
parent edb7ab0a1a
commit 8fd707e1f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -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)
-------------------------------

View File

@ -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]);