Fix #18909: Fix bug with binding default action parameters for controllers

This commit is contained in:
Bizley
2021-10-19 00:01:46 +02:00
committed by GitHub
parent e22bece3df
commit ae82b58d85
4 changed files with 13 additions and 6 deletions

View File

@@ -226,7 +226,12 @@ class Controller extends \yii\base\Controller
}
$args[] = $actionParams[$key] = $params[$key];
unset($params[$key]);
} elseif (PHP_VERSION_ID >= 70100 && ($type = $param->getType()) !== null) {
} elseif (
PHP_VERSION_ID >= 70100
&& ($type = $param->getType()) !== null
&& $type instanceof \ReflectionNamedType
&& !$type->isBuiltin()
) {
try {
$this->bindInjectedParams($type, $name, $args, $requestedParams);
} catch (\yii\base\Exception $e) {