diff --git a/README.md b/README.md index 691cea6c3..33de02cee 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,10 @@ It means that composer will look at `master` branch of repository configured und ## Changelog +### 2022-03-08 + +- Fixed passing `params["pass"]` argument to `invokeArgs` when resolving controller action - `array_values` used to avoid problems with named parameters. + ### 2022-03-03 - Removed `String` class. diff --git a/lib/Cake/Controller/Controller.php b/lib/Cake/Controller/Controller.php index 19e54692d..a0cc93b52 100644 --- a/lib/Cake/Controller/Controller.php +++ b/lib/Cake/Controller/Controller.php @@ -496,8 +496,13 @@ class Controller extends CakeObject implements CakeEventListener { 'action' => $request->params['action'] )); } - return $method->invokeArgs($this, $request->params['pass']); + return $method->invokeArgs( + $this, + is_array($request->params['pass']) + ? array_values($request->params['pass']) + : [] + ); } catch (ReflectionException $e) { if ($this->scaffold !== false) { return $this->_getScaffold($request);