From c1e9739ed232e207ff6920e90b7351b2b19f69d0 Mon Sep 17 00:00:00 2001 From: Yusup Hambali Date: Wed, 20 Nov 2019 00:10:26 +0700 Subject: [PATCH] Fix #17670: Fix overriding core component class using `__class` --- framework/CHANGELOG.md | 1 + framework/base/Application.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index ff90ce6d4e..9c27890ab2 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -8,6 +8,7 @@ Yii Framework 2 Change Log - Bug #17648: Handle empty column arrays in console `Table` widget (alex-code) - Bug #17657: Fix migration errors from missing `$schema` in RBAC init file when using MSSQL (PoohOka) - Bug #17434: IE Ajax redirect fix for non 11.0 versions (kamarton) +- Bug #17670: Fix overriding core component class using `__class` (sup-ham, samdark) 2.0.29 October 22, 2019 ----------------------- diff --git a/framework/base/Application.php b/framework/base/Application.php index d7771bf636..22fa52f465 100644 --- a/framework/base/Application.php +++ b/framework/base/Application.php @@ -258,7 +258,7 @@ abstract class Application extends Module foreach ($this->coreComponents() as $id => $component) { if (!isset($config['components'][$id])) { $config['components'][$id] = $component; - } elseif (is_array($config['components'][$id]) && !isset($config['components'][$id]['class'])) { + } elseif (is_array($config['components'][$id]) && !isset($config['components'][$id]['class']) && !isset($config['components'][$id]['__class'])) { $config['components'][$id]['class'] = $component['class']; } }