PathProcessorDecode.php

Same filename and directory in other branches
  1. 8.9.x core/lib/Drupal/Core/PathProcessor/PathProcessorDecode.php
  2. 10 core/lib/Drupal/Core/PathProcessor/PathProcessorDecode.php
  3. 11.x core/lib/Drupal/Core/PathProcessor/PathProcessorDecode.php

Namespace

Drupal\Core\PathProcessor

File

core/lib/Drupal/Core/PathProcessor/PathProcessorDecode.php

View source
<?php

namespace Drupal\Core\PathProcessor;

use Symfony\Component\HttpFoundation\Request;

/**
 * Processes the inbound path by urldecoding it.
 *
 * 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.
 */
class PathProcessorDecode implements InboundPathProcessorInterface {
    
    /**
     * {@inheritdoc}
     */
    public function processInbound($path, Request $request) {
        return urldecode($path);
    }

}

Classes

Title Deprecated Summary
PathProcessorDecode Processes the inbound path by urldecoding it.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.