From d4976e55544ddab17713e2f3aa4f5f5f5eb9986f Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Thu, 13 Oct 2016 10:53:04 +0200 Subject: 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(-) (limited to 'lib') diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index 9210dfd1fd1..33801cd6347 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -1059,7 +1059,7 @@ class Share extends Constants { if (isset($groupShare['file_target'])) { $shareTmp['fileTarget'] = $groupShare['file_target']; } - $listOfUnsharedItems = array_merge($listOfUnsharedItems, array($groupShare)); + $listOfUnsharedItems = array_merge($listOfUnsharedItems, [$shareTmp]); $itemUnshared = true; } elseif (!$itemUnshared && isset($uniqueGroupShare)) { $query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `permissions` = ? WHERE `id` = ?'); @@ -1074,7 +1074,7 @@ class Share extends Constants { if (isset($uniqueGroupShare['file_target'])) { $shareTmp['fileTarget'] = $uniqueGroupShare['file_target']; } - $listOfUnsharedItems = array_merge($listOfUnsharedItems, array($uniqueGroupShare)); + $listOfUnsharedItems = array_merge($listOfUnsharedItems, [$shareTmp]); $itemUnshared = true; } -- cgit v1.2.3