Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-05-24 13:08:07 +0300
committerCarl Schwan <carl@carlschwan.eu>2022-07-28 17:53:22 +0300
commit9493f86de34e76e37c13f87aab3123a3efbfdd84 (patch)
tree7d4a1995bfd372fae5a506e9af5e396d6ec5b96b /apps/files_sharing/lib/Controller
parenta95c19e14b5a371240392de480278ee97c01ab12 (diff)
Fix share controller to accept share attributes alone
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'apps/files_sharing/lib/Controller')
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index e40aed0da70..f5c64c5d0d0 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);