diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2015-06-25 21:16:18 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2015-06-25 21:16:18 +0200 |
commit | 27d5838fb7046295adc7b4f4b29225a392b640e4 (patch) | |
tree | 0c5c096b65baac547f42df384f83de01e79fe39f /core | |
parent | 9be1d08c3cb669f4829b0aa4af53d90cf3a9d153 (diff) | |
download | nextcloud-server-27d5838fb7046295adc7b4f4b29225a392b640e4.tar.gz nextcloud-server-27d5838fb7046295adc7b4f4b29225a392b640e4.zip |
Fix for #17178
If no array of arrays is submitted make sure we still keep $sharedUsers
and $sharedGroups as arrays so the rest of the code keeps functioning as
it should.
Diffstat (limited to 'core')
-rw-r--r-- | core/ajax/share.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/core/ajax/share.php b/core/ajax/share.php index e78d274815d..f84325dc17e 100644 --- a/core/ajax/share.php +++ b/core/ajax/share.php @@ -273,8 +273,15 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo $sharedUsers = []; $sharedGroups = []; if (isset($_GET['itemShares'])) { - $sharedUsers = isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]) ? $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER] : []; - $sharedGroups = isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) ? $_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP] : []; + if (isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]) && + is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_USER])) { + $sharedUsers = $_GET['itemShares'][OCP\Share::SHARE_TYPE_USER]; + } + + if (isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]) && + is_array($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP])) { + $sharedGroups = isset($_GET['itemShares'][OCP\Share::SHARE_TYPE_GROUP]); + } } $count = 0; |