diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 302698ff536..fcf1aa21f2f 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -27,6 +27,7 @@ Yii Framework 2 Change Log - New #20137: Added `yii\caching\CallbackDependency` to allow using a callback to determine if a cache dependency is still valid (laxity7) - Enh #20134: Raise minimum `PHP` version to `7.3` (@terabytesoftw) - Bug #20141: Update `ezyang/htmlpurifier` dependency to version `4.17` (@terabytesoftw) +- Bug #20159: Fixed chroot resolve null route (gozoro) 2.0.49.2 October 12, 2023 ------------------------- diff --git a/framework/console/Request.php b/framework/console/Request.php index 6164b2c3413..047ecb18141 100644 --- a/framework/console/Request.php +++ b/framework/console/Request.php @@ -65,7 +65,7 @@ public function resolve() if ($route === '--') { $endOfOptionsFound = true; - $route = array_shift($rawParams); + $route = (string)array_shift($rawParams); } } else { $route = ''; diff --git a/tests/framework/console/RequestTest.php b/tests/framework/console/RequestTest.php index 64d36e9df93..22208a0e16d 100644 --- a/tests/framework/console/RequestTest.php +++ b/tests/framework/console/RequestTest.php @@ -121,6 +121,16 @@ public function provider() '-alias2=testValue', ], ], + ], + [ + // Case: Special argument "End of Options" placed instead of route + 'params' => [ + '--', // Special argument "End of Options" + ], + 'expected' => [ + 'route' => '', + 'params' => [], + ], ], // Case: `--