Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. UriNormalizer.php

function UriNormalizer::decodeUnreservedCharacters

1 call to UriNormalizer::decodeUnreservedCharacters()
UriNormalizer::normalize in vendor/guzzlehttp/psr7/src/UriNormalizer.php
Returns a normalized URI.

File

vendor/guzzlehttp/psr7/src/UriNormalizer.php, line 200

Class

UriNormalizer
Provides methods to normalize and compare URIs.

Namespace

GuzzleHttp\Psr7

Code

private static function decodeUnreservedCharacters(UriInterface $uri) : UriInterface {
    $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i';
    $callback = function (array $match) : string {
        return rawurldecode($match[0]);
    };
    return $uri->withPath(preg_replace_callback($regex, $callback, $uri->getPath()))
        ->withQuery(preg_replace_callback($regex, $callback, $uri->getQuery()));
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal