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\Psr7Code
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()));
}