From 1eca72d417dce6901aa897c595b8a085239ceed4 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 24 May 2022 12:08:07 +0200 Subject: [PATCH] Fix share controller to accept share attributes alone Signed-off-by: Vincent Petry --- apps/files_sharing/lib/Controller/ShareAPIController.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index d0a6c59c34d..c6da924bf38 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -1077,6 +1077,8 @@ class ShareAPIController extends OCSController { throw new OCSForbiddenException('You are not allowed to edit incoming shares'); } + $shareAttributes = $this->request->getParam('attributes', null); + if ( $permissions === null && $password === null && @@ -1085,7 +1087,8 @@ class ShareAPIController extends OCSController { $expireDate === null && $note === null && $label === null && - $hideDownload === null + $hideDownload === null && + $shareAttributes === null ) { throw new OCSBadRequestException($this->l->t('Wrong or no update parameter given')); } @@ -1224,7 +1227,7 @@ class ShareAPIController extends OCSController { } } - $share = $this->setShareAttributes($share, $this->request->getParam('attributes', null)); + $share = $this->setShareAttributes($share, $shareAttributes); try { $share = $this->shareManager->updateShare($share);