diff --git a/core/lib/Drupal/Core/Routing/Router.php b/core/lib/Drupal/Core/Routing/Router.php index 6fb0b23c07..580effbe7f 100644 --- a/core/lib/Drupal/Core/Routing/Router.php +++ b/core/lib/Drupal/Core/Routing/Router.php @@ -194,6 +194,8 @@ public function matchRequest(Request $request) { if ($this->checkAccess) { $this->checkAccess($request); } + // We can not return $parameters because the access check can change the + // request attributes. return $request->attributes->all(); } @@ -417,7 +419,7 @@ protected function sortFilters() { } /** - * Apply access check service to the route and parameters in the request. + * Applies access check service to the route and parameters in the request. * * @param \Symfony\Component\HttpFoundation\Request $request * The request to access check.