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 3820d6883d

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-11-28 16:38:16 +01:00
parent 3cbd6509e0
commit 76a2fb0231
No known key found for this signature in database
GPG Key ID: 7076EA9751AACDDA
1 changed files with 7 additions and 1 deletions

View File

@ -1407,7 +1407,13 @@ class Manager implements IManager {
foreach ($tmp as $k => $v) { foreach ($tmp as $k => $v) {
if (isset($al[$k])) { if (isset($al[$k])) {
if (is_array($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 { } else {
$al[$k] = $al[$k] || $v; $al[$k] = $al[$k] || $v;
} }