Modify pickKey to examine parent array before nested arrays.

This commit is contained in:
Judebert 2008-02-19 19:48:53 +00:00
parent 918fc1160d
commit 8b86a8c419

View File

@ -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];