Merge pull request #18734 from nextcloud/backport/18728/stable17

[stable17]  Trash bin: fix exception triggered if no correct fileId is provided.
This commit is contained in:
Roeland Jago Douma 2020-01-08 14:57:04 +01:00 committed by GitHub
commit 1e37bd2fd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -84,12 +84,12 @@ class PreviewController extends Controller {
* @return DataResponse|Http\FileDisplayResponse * @return DataResponse|Http\FileDisplayResponse
*/ */
public function getPreview( public function getPreview(
int $fileId, int $fileId = -1,
int $x = 128, int $x = 128,
int $y = 128 int $y = 128
) { ) {
if ($x === 0 || $y === 0) { if ($fileId === -1 || $x === 0 || $y === 0) {
return new DataResponse([], Http::STATUS_BAD_REQUEST); return new DataResponse([], Http::STATUS_BAD_REQUEST);
} }