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

Breadcrumb

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

function UriNormalizer::capitalizePercentEncoding

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

File

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

Class

UriNormalizer
Provides methods to normalize and compare URIs.

Namespace

GuzzleHttp\Psr7

Code

private static function capitalizePercentEncoding(UriInterface $uri) : UriInterface {
    $regex = '/(?:%[A-Fa-f0-9]{2})++/';
    $callback = function (array $match) : string {
        return strtoupper($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