From a05bdcf1df78a41df546f5939c3e921f087fda13 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 13 Oct 2016 10:53:04 +0200 Subject: [PATCH] Fix post_unshareFromSelf hook parameter format When unsharing from self in a group share situation, the share items passed to the post_unshareFromSelf hook were using the wrong format in which the attribute names (ex: "share_type") have non camel-case format. This fix makes sure that in group sharing case we use the correct format. It looks like the code was already producing it but in array_merge it was not using it and adding the unprocessed one. --- lib/private/share/share.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/share/share.php b/lib/private/share/share.php index 1dc685190b6dd..d5ce1e92e5013 100644 --- a/lib/private/share/share.php +++ b/lib/private/share/share.php @@ -1042,7 +1042,7 @@ public static function unshareFromSelf($itemType, $itemOrigin, $originIsSource = if (isset($groupShare['file_target'])) { $shareTmp['fileTarget'] = $groupShare['file_target']; } - $listOfUnsharedItems = array_merge($listOfUnsharedItems, array($groupShare)); + $listOfUnsharedItems = array_merge($listOfUnsharedItems, array($shareTmp)); $itemUnshared = true; } elseif (!$itemUnshared && isset($uniqueGroupShare)) { $query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `permissions` = ? WHERE `id` = ?'); @@ -1057,7 +1057,7 @@ public static function unshareFromSelf($itemType, $itemOrigin, $originIsSource = if (isset($uniqueGroupShare['file_target'])) { $shareTmp['fileTarget'] = $uniqueGroupShare['file_target']; } - $listOfUnsharedItems = array_merge($listOfUnsharedItems, array($uniqueGroupShare)); + $listOfUnsharedItems = array_merge($listOfUnsharedItems, array($shareTmp)); $itemUnshared = true; }