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

Breadcrumb

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

function Utils::redactUserInfo

Redact the password in the user info part of a URI.

1 call to Utils::redactUserInfo()
RequestException::create in vendor/guzzlehttp/guzzle/src/Exception/RequestException.php
Factory method to create a new exception with a normalized error message

File

vendor/guzzlehttp/psr7/src/Utils.php, line 256

Class

Utils

Namespace

GuzzleHttp\Psr7

Code

public static function redactUserInfo(UriInterface $uri) : UriInterface {
    $userInfo = $uri->getUserInfo();
    if (false !== ($pos = \strpos($userInfo, ':'))) {
        return $uri->withUserInfo(\substr($userInfo, 0, $pos), '***');
    }
    return $uri;
}

API Navigation

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