mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-14 14:28:27 +08:00
#9915: changed behavior of ArrayHelper::getValue() according to @azureru suggestion
This commit is contained in:
@ -198,7 +198,7 @@ class BaseArrayHelper
|
||||
$key = substr($key, $pos + 1);
|
||||
}
|
||||
|
||||
if (is_object($array) && isset($array->$key)) {
|
||||
if (is_object($array) && property_exists($array, $key)) {
|
||||
return $array->$key;
|
||||
} elseif (is_array($array)) {
|
||||
return array_key_exists($key, $array) ? $array[$key] : $default;
|
||||
|
Reference in New Issue
Block a user