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

Breadcrumb

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

function Uri::validateState

File

vendor/guzzlehttp/psr7/src/Uri.php, line 728

Class

Uri
PSR-7 URI implementation.

Namespace

GuzzleHttp\Psr7

Code

private function validateState() : void {
    if ($this->host === '' && ($this->scheme === 'http' || $this->scheme === 'https')) {
        $this->host = self::HTTP_DEFAULT_HOST;
    }
    if ($this->getAuthority() === '') {
        if (0 === strpos($this->path, '//')) {
            throw new MalformedUriException('The path of a URI without an authority must not start with two slashes "//"');
        }
        if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) {
            throw new MalformedUriException('A relative URI must not have a path beginning with a segment containing a colon');
        }
    }
}

API Navigation

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