Modify pickKey to examine parent array before nested arrays.
This commit is contained in:
parent
918fc1160d
commit
8b86a8c419
@ -1149,6 +1149,10 @@ function &serendipity_pickKey(&$array, $key, $default) {
|
||||
return $default;
|
||||
}
|
||||
|
||||
// array_key_exists() copies array, so is much slower.
|
||||
if (in_array($key, array_keys($array))) {
|
||||
return $array[$key];
|
||||
}
|
||||
foreach($array AS $child) {
|
||||
if (is_array($child) && isset($child[$key]) && !empty($child[$key])) {
|
||||
return $child[$key];
|
||||
|
Loading…
x
Reference in New Issue
Block a user