From a5a0ccd551728bdb5955ae12391bb26604e36ae4 Mon Sep 17 00:00:00 2001 From: Kamil Wylegala Date: Tue, 8 Mar 2022 19:55:03 +0100 Subject: [PATCH] Fixed passing arguments to invokeArgs when resolving controller's action. --- README.md | 4 ++++ lib/Cake/Controller/Controller.php | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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);