Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-11-28 18:38:16 +0300
committerJoas Schilling <coding@schilljs.com>2017-11-28 19:24:19 +0300
commit76a2fb0231acf86d87cb6d8026e7f08936a21f15 (patch)
treeb3cbef5f171b265457b58c653f00d5d8da759801
parent3cbd6509e04165ce4e8a2ab892f7c44948d2f1d0 (diff)
Only in case of $currentAccess the array uses the id as index
Otherwise its a normal string[] with the user ids, in that case the array_merge did it's job just fine, apart from it not being deduplicated. The array+array is only needed when the user id is the key, so integer only user ids are kept as they are instead of being reindexed. Regression from 3820d6883dffcaa49deb1054ae0f32ab3d3e39b1 Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/private/Share20/Manager.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index be019852ff3..46b47920ce1 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -1407,7 +1407,13 @@ class Manager implements IManager {
foreach ($tmp as $k => $v) {
if (isset($al[$k])) {
if (is_array($al[$k])) {
- $al[$k] += $v;
+ if ($currentAccess) {
+ $al[$k] += $v;
+ } else {
+ $al[$k] = array_merge($al[$k], $v);
+ $al[$k] = array_unique($al[$k]);
+ $al[$k] = array_values($al[$k]);
+ }
} else {
$al[$k] = $al[$k] || $v;
}