Skip to content

Commit

Permalink
bug #1410787, incorrect merging of parameters contained in an array
Browse files Browse the repository at this point in the history
  • Loading branch information
lem9 committed Jan 22, 2006
1 parent 412680d commit 2edb509
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ChangeLog
Expand Up @@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$

2006-01-22 Marc Delisle <lem9@users.sourceforge.net>
* libraries/common.lib.php: bug #1410787, incorrect merging of parameters
contained in an array

2006-01-21 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* tbl_printview.php: typo

Expand Down
10 changes: 9 additions & 1 deletion libraries/common.lib.php
Expand Up @@ -440,6 +440,7 @@ function PMA_array_merge_recursive()
return false;
break;
case 1 :
// when does that happen?
return func_get_arg(0);
break;
case 2 :
Expand All @@ -448,10 +449,17 @@ function PMA_array_merge_recursive()
return $args[1];
}
foreach ($args[1] AS $key2 => $value2) {
if (isset($args[0][$key2])) {
if (isset($args[0][$key2]) && !is_int($key2)) {
$args[0][$key2] = PMA_array_merge_recursive($args[0][$key2],
$value2);
} else {
// we erase the parent array, otherwise we cannot override a directive that
// contains array elements, like this:
// (in config.default.php) $cfg['ForeignKeyDropdownOrder'] = array('id-content','content-id');
// (in config.inc.php) $cfg['ForeignKeyDropdownOrder'] = array('content-id');
if (is_int($key2) && $key2 == 0) {
unset($args[0]);
}
$args[0][$key2] = $value2;
}
}
Expand Down

0 comments on commit 2edb509

Please sign in to comment.