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

Breadcrumb

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

function UriResolver::cleanupAnchor

Removes the anchor from the uri.

2 calls to UriResolver::cleanupAnchor()
UriResolver::cleanupUri in vendor/symfony/dom-crawler/UriResolver.php
Removes the query string and the anchor from the given uri.
UriResolver::resolve in vendor/symfony/dom-crawler/UriResolver.php
Resolves a URI according to a base URI.

File

vendor/symfony/dom-crawler/UriResolver.php, line 128

Class

UriResolver
The UriResolver class takes an URI (relative, absolute, fragment, etc.) and turns it into an absolute URI against another given base URI.

Namespace

Symfony\Component\DomCrawler

Code

private static function cleanupAnchor(string $uri) : string {
    if (false !== ($pos = strpos($uri, '#'))) {
        return substr($uri, 0, $pos);
    }
    return $uri;
}
RSS feed
Powered by Drupal