diff options
author | Julius Härtl <jus@bitgrid.net> | 2024-06-21 11:37:47 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2024-07-22 22:32:34 +0200 |
commit | 6c1e896a03f20e568df5af1d547f46e2df9b71a9 (patch) | |
tree | 7dfae53a850091e284cc713f0158378fe7c663bf /apps/files/lib | |
parent | 8cc996155e77e10a626906550a74953fb4a6928d (diff) | |
download | nextcloud-server-6c1e896a03f20e568df5af1d547f46e2df9b71a9.tar.gz nextcloud-server-6c1e896a03f20e568df5af1d547f46e2df9b71a9.zip |
fix: Ignore preview requests for invalid file ids
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/Controller/ApiController.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/files/lib/Controller/ApiController.php b/apps/files/lib/Controller/ApiController.php index 64082fbfd85..9cf634f9404 100644 --- a/apps/files/lib/Controller/ApiController.php +++ b/apps/files/lib/Controller/ApiController.php @@ -93,6 +93,10 @@ class ApiController extends Controller { throw new NotFoundException(); } + if ($file->getId() <= 0) { + return new DataResponse(['message' => 'File not found.'], Http::STATUS_NOT_FOUND); + } + /** @var File $file */ $preview = $this->previewManager->getPreview($file, $x, $y, true); |