Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix share controller to accept share attributes alone
Signed-off-by: Vincent Petry <[email protected]>
  • Loading branch information
PVince81 authored and CarlSchwan committed Jul 28, 2022
commit 9493f86de34e76e37c13f87aab3123a3efbfdd84
7 changes: 5 additions & 2 deletions apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,8 @@ public function updateShare(
throw new OCSForbiddenException('You are not allowed to edit incoming shares');
}

$shareAttributes = $this->request->getParam('attributes', null);

if (
$permissions === null &&
$password === null &&
Expand All @@ -1085,7 +1087,8 @@ public function updateShare(
$expireDate === null &&
$note === null &&
$label === null &&
$hideDownload === null
$hideDownload === null &&
$shareAttributes === null
) {
throw new OCSBadRequestException($this->l->t('Wrong or no update parameter given'));
}
Expand Down Expand Up @@ -1224,7 +1227,7 @@ public function updateShare(
}
}

$share = $this->setShareAttributes($share, $this->request->getParam('attributes', null));
$share = $this->setShareAttributes($share, $shareAttributes);

try {
$share = $this->shareManager->updateShare($share);
Expand Down