From 0bf406e597f2c9e02a226aa0a9e772ba40abacfc Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Mon, 1 Jun 2026 16:18:00 +0100 Subject: [PATCH] Tighten param reconstruction Use Request::getParam() for the query/body+default fallback instead of a cached getParams() copy, dropping the temporary and shortening the diff. Co-Authored-By: Claude Opus 4.8 (1M context) --- app/controllers/shared/api.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index c3db25ab72..d22c80d1b2 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -863,14 +863,11 @@ Http::shutdown() } } - // $params holds the URL path values (injected from the route match); - // merge in query/body params and declared defaults to reproduce the - // full resolved param set, with path values taking precedence. - $reqParams = $request->getParams(); - + // Reproduce the resolved param set: injected path values take precedence + // over query/body params, falling back to each param's declared default. $requestParams = []; foreach ($route->getParams() as $key => $param) { - $requestParams[$key] = $params[$key] ?? $reqParams[$key] ?? $param['default']; + $requestParams[$key] = $params[$key] ?? $request->getParam($key, $param['default']); } /**