UrlGenerator::$decodedChars

Overrides characters that will not be percent-encoded in the path segment.

The first two elements are the first two parameters of str_replace(), so if you override this variable you can also use arrays for the encoded and decoded characters.

See also

\Symfony\Component\Routing\Generator\UrlGenerator

File

core/lib/Drupal/Core/Routing/UrlGenerator.php, line 57

Class

UrlGenerator
Generates URLs from route names and parameters.

Namespace

Drupal\Core\Routing

Code

1
2
3
4
5
6
7
protected $decodedChars = [
  // the slash can be used to designate a hierarchical structure and we want allow using it with this meaning
  // some webservers don't allow the slash in encoded form in the path for security reasons anyway
  '%2F', // Map from these encoded characters.
  '/', // Map to these decoded characters.
];
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.