aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib
diff options
context:
space:
mode:
authorskjnldsv <skjnldsv@protonmail.com>2024-07-05 14:27:49 +0200
committerJohn Molakvoæ <skjnldsv@users.noreply.github.com>2024-07-12 20:14:30 +0200
commit75ca4944c9e9a1b20bdb1e01f5acf59f2c77afe2 (patch)
tree76848e6508759a1045883e27bbd64ba669660747 /apps/files_sharing/lib
parentc253112cf77411ee374ea29a9566cdd28d3e544d (diff)
downloadnextcloud-server-75ca4944c9e9a1b20bdb1e01f5acf59f2c77afe2.tar.gz
nextcloud-server-75ca4944c9e9a1b20bdb1e01f5acf59f2c77afe2.zip
feat(files_sharing): allow mixed values in share attributes and allow storing email arrays
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r--apps/files_sharing/lib/Controller/ShareAPIController.php9
-rw-r--r--apps/files_sharing/lib/MountProvider.php2
2 files changed, 9 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php
index 72ebd39ea07..e2ea4012208 100644
--- a/apps/files_sharing/lib/Controller/ShareAPIController.php
+++ b/apps/files_sharing/lib/Controller/ShareAPIController.php
@@ -1986,10 +1986,17 @@ class ShareAPIController extends OCSController {
$formattedShareAttributes = \json_decode($attributesString, true);
if (is_array($formattedShareAttributes)) {
foreach ($formattedShareAttributes as $formattedAttr) {
+ // Legacy handling of the 'enabled' attribute
+ if ($formattedAttr['enabled']) {
+ $formattedAttr['value'] = is_string($formattedAttr['enabled'])
+ ? (bool) \json_decode($formattedAttr['enabled'])
+ : $formattedAttr['enabled'];
+ }
+
$newShareAttributes->setAttribute(
$formattedAttr['scope'],
$formattedAttr['key'],
- is_string($formattedAttr['enabled']) ? (bool) \json_decode($formattedAttr['enabled']) : $formattedAttr['enabled']
+ $formattedAttr['value'],
);
}
} else {
diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php
index b70c16872ee..8968f6fa4d1 100644
--- a/apps/files_sharing/lib/MountProvider.php
+++ b/apps/files_sharing/lib/MountProvider.php
@@ -215,7 +215,7 @@ class MountProvider implements IMountProvider {
continue;
}
// update supershare attributes with subshare attribute
- $superAttributes->setAttribute($attribute['scope'], $attribute['key'], $attribute['enabled']);
+ $superAttributes->setAttribute($attribute['scope'], $attribute['key'], $attribute['value']);
}
}