public function PathSubscriber::onKernelRequestDecodePath

Decodes the path of the request.

Parameters in the URL sometimes represent code-meaningful strings. It is therefore useful to always urldecode() those values so that individual controllers need not concern themselves with it. This is Drupal-specific logic and may not be familiar for developers used to other Symfony-family projects.

@todo Revisit whether or not this logic is appropriate for here or if controllers should be required to implement this logic themselves. If we decide to keep this code, remove this TODO.

Parameters

Symfony\Component\HttpKernel\Event\GetResponseEvent $event: The Event to process.

File

drupal/core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php, line 109
Definition of Drupal\Core\EventSubscriber\PathSubscriber.

Class

PathSubscriber
Access subscriber for controller requests.

Namespace

Drupal\Core\EventSubscriber

Code

public function onKernelRequestDecodePath(GetResponseEvent $event) {
  $request = $event
    ->getRequest();
  $path = $this
    ->extractPath($request);
  $path = urldecode($path);
  $this
    ->setPath($request, $path);
}