PathProcessorDecode.php 868 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace Drupal\Core\PathProcessor;
  3. use Symfony\Component\HttpFoundation\Request;
  4. /**
  5. * Processes the inbound path by urldecoding it.
  6. *
  7. * Parameters in the URL sometimes represent code-meaningful strings. It is
  8. * therefore useful to always urldecode() those values so that individual
  9. * controllers need not concern themselves with it. This is Drupal-specific
  10. * logic and may not be familiar for developers used to other Symfony-family
  11. * projects.
  12. *
  13. * @todo Revisit whether or not this logic is appropriate for here or if
  14. * controllers should be required to implement this logic themselves. If we
  15. * decide to keep this code, remove this TODO.
  16. */
  17. class PathProcessorDecode implements InboundPathProcessorInterface {
  18. /**
  19. * {@inheritdoc}
  20. */
  21. public function processInbound($path, Request $request) {
  22. return urldecode($path);
  23. }
  24. }