Permalink
Browse files

Fix some array_merge usages that can conflict with numeric keys.

  • Loading branch information...
1 parent 9ab1c80 commit 96183ac333137aa2eb1d2db955f5d96c0d97e70e @cdujeu cdujeu committed Oct 6, 2016
@@ -275,7 +275,7 @@ public static function getRolesList($roleIds = array(), $excludeReserved = false
}
if(isSet($found) && count($found)){
// Add the ones loaded from cache
- $roles = array_merge($roles, $found);
+ $roles = $roles + $found;
}
if (self::$useCache && !count($roleIds) && $excludeReserved == true) {
self::$rolesCache = $roles;
@@ -189,7 +189,7 @@ protected static function initPath($path, $streamType, $storeOpenContext = false
}
}
}
- self::$currentListing = array_merge($folders, $builtFolders, $files);
+ self::$currentListing = $folders + $builtFolders + $files;
self::$currentListingKeys = array_keys(self::$currentListing);
self::$currentListingIndex = 0;
return -1;
@@ -89,7 +89,7 @@ public function setMetadata($ajxpNode, $nameSpace, $metaData, $private = false,
if (!isSet(self::$metaCache[$nameSpace])) {
self::$metaCache[$nameSpace] = array();
}
- self::$metaCache[$nameSpace] = array_merge(self::$metaCache[$nameSpace], $metaData);
+ self::$metaCache[$nameSpace] = self::$metaCache[$nameSpace] + $metaData;
if(is_array(self::$metaCache[$nameSpace])){
foreach(self::$metaCache[$nameSpace] as $k => $v){
if($v == AJXP_VALUE_CLEAR) unset(self::$metaCache[$nameSpace][$k]);

0 comments on commit 96183ac

Please sign in to comment.