You are here

private static function UriNormalizer::decodeUnreservedCharacters in Lockr 7.3

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 196

Class

UriNormalizer
Provides methods to normalize and compare URIs.

Namespace

GuzzleHttp\Psr7

Code

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