summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-11-28 16:38:16 +0100
committerJoas Schilling <coding@schilljs.com>2017-11-28 17:17:51 +0100
commit80b34f5f7df48a8632fd92116bc14e8a1a7fb3e2 (patch)
treeb0d7edd2650bf75b0115591fe4a676cc213862fa /lib
parent2a01c0f3f65146858ef944c68adf5142988b5b52 (diff)
downloadnextcloud-server-80b34f5f7df48a8632fd92116bc14e8a1a7fb3e2.tar.gz
nextcloud-server-80b34f5f7df48a8632fd92116bc14e8a1a7fb3e2.zip
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>
Diffstat (limited to 'lib')
-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 b22bfbc3878..b8131425b4a 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -1395,7 +1395,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;
}