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.
This commit is contained in:
Roeland Jago Douma 2015-06-25 21:16:18 +02:00
parent 9be1d08c3c
commit 27d5838fb7

View file

@ -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;