Fix #18505: Fixed ArrayHelper::get() for ArrayAccess objects with explicitly defined properties

Co-authored-by: Bizley <pawel@positive.codes>
This commit is contained in:
Alexander Makarov
2021-02-04 15:30:56 +03:00
committed by GitHub
parent 95c2d214d9
commit 71791d790d
3 changed files with 34 additions and 0 deletions

View File

@ -17,6 +17,7 @@ Yii Framework 2 Change Log
- Enh #18493: Faster request parsing for REST UrlRule with prefix handling (bizley)
- Enh #18487: Allow creating URLs for non-GET-verb rules (bizley)
- Bug #8750: Fix MySQL support when running in `ANSI`/`ANSI_QUOTES` modes (brandonkelly)
- Bug #18505: Fixed `yii\helpers\ArrayHelper::getValue()` for ArrayAccess objects with explicitly defined properties (samdark)
2.0.40 December 23, 2020

View File

@ -196,6 +196,10 @@ class BaseArrayHelper
$key = $lastKey;
}
if (is_object($array) && property_exists($array, $key)) {
return $array->$key;
}
if (static::keyExists($key, $array)) {
return $array[$key];
}