diff options
author | skjnldsv <skjnldsv@protonmail.com> | 2024-07-05 14:27:49 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-07-12 20:14:30 +0200 |
commit | 75ca4944c9e9a1b20bdb1e01f5acf59f2c77afe2 (patch) | |
tree | 76848e6508759a1045883e27bbd64ba669660747 /apps/files_sharing/lib | |
parent | c253112cf77411ee374ea29a9566cdd28d3e544d (diff) | |
download | nextcloud-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.php | 9 | ||||
-rw-r--r-- | apps/files_sharing/lib/MountProvider.php | 2 |
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']); } } |