diff --git a/core/lib/Drupal/Core/Routing/CurrentRouteMatch.php b/core/lib/Drupal/Core/Routing/CurrentRouteMatch.php index 6745992..41e4d17 100644 --- a/core/lib/Drupal/Core/Routing/CurrentRouteMatch.php +++ b/core/lib/Drupal/Core/Routing/CurrentRouteMatch.php @@ -16,11 +16,15 @@ class CurrentRouteMatch implements RouteMatchInterface { /** + * The related request stack. + * * @var \Symfony\Component\HttpFoundation\RequestStack */ protected $requestStack; /** + * Internal cache of RouteMatch objects. + * * @var \SplObjectStorage */ protected $routeMatches; @@ -73,7 +77,7 @@ public function getRawParameters() { } /** - * Load a routeMatch from a request variable. + * Load a RouteMatch from a request variable. * * @param \Symfony\Component\HttpFoundation\Request $request * A Symfony request object that's been routed. diff --git a/core/lib/Drupal/Core/Routing/RouteMatch.php b/core/lib/Drupal/Core/Routing/RouteMatch.php index 08cab36..faa6a3f 100644 --- a/core/lib/Drupal/Core/Routing/RouteMatch.php +++ b/core/lib/Drupal/Core/Routing/RouteMatch.php @@ -73,11 +73,16 @@ public function __construct($route_name, Route $route, array $parameters = array * @return static */ public static function createFromRequest(Request $request) { + + $raw_variables = array(); + if ($raw = $request->get('_raw_variables')) { + $raw_variables = $raw->all(); + } return new static( $request->attributes->get(RouteObjectInterface::ROUTE_NAME), $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT), $request->attributes->all(), - $request->get('_raw_variables')->all()); + $raw_variables); } /**