Skip to content
Browse files

Missed last _merge_arrays change in Config: more compact

  • Loading branch information...
1 parent b9ec0ba commit 9c57cd384b56f07d1fbbe078720032c3d7d865fc @dchill42 committed
Showing with 3 additions and 11 deletions.
  1. +3 −11 system/core/Config.php
View
14 system/core/Config.php
@@ -467,17 +467,9 @@ protected function _merge_arrays(array $main, array &$new)
// Iterate values of new array
foreach ($new as $key => &$value)
{
- // Check for sub-arrays to merge
- if (is_array($value) && isset($main[$key]) && is_array($main[$key]))
- {
- // Merge new sub-array with main sub-array
- $main[$key] = $this->_merge_arrays($main[$key], $value);
- }
- else
- {
- // Add/replace value in main array
- $main[$key] = $value;
- }
+ // Merge sub-arrays recursively, add/replace all others
+ $main[$key] = (is_array($value) && isset($main[$key]) && is_array($main[$key])) ?
+ $this->_merge_arrays($main[$key], $value) : $value;
}
// Return merged array

0 comments on commit 9c57cd3

Please sign in to comment.
Something went wrong with that request. Please try again.