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

Breadcrumb

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

function StreamWrapperManager::getTarget

Overrides StreamWrapperManagerInterface::getTarget

8 calls to StreamWrapperManager::getTarget()
ConfigHooks::fileDownload in core/modules/config/src/Hook/ConfigHooks.php
Implements hook_file_download().
hook_file_download in core/lib/Drupal/Core/File/file.api.php
Control access to private file downloads and specify HTTP headers.
ImageHooks::fileDownload in core/modules/image/src/Hook/ImageHooks.php
Implements hook_file_download().
ImageStyle::buildUri in core/modules/image/src/Entity/ImageStyle.php
Returns the URI of this image when using this style.
ImageStyleDownloadController::getUriWithoutConvertedExtension in core/modules/image/src/Controller/ImageStyleDownloadController.php
Get the file URI without the extension from any conversion image style.

... See full list

File

core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php, line 222

Class

StreamWrapperManager
Provides a StreamWrapper manager.

Namespace

Drupal\Core\StreamWrapper

Code

public static function getTarget($uri) {
    // Remove the scheme from the URI and remove erroneous leading or trailing,
    // forward-slashes and backslashes.
    $target = trim(preg_replace('/^[\\w\\-]+:\\/\\/|^data:/', '', $uri), '\\/');
    // If nothing was replaced, the URI doesn't have a valid scheme.
    return $target !== $uri ? $target : FALSE;
}
RSS feed
Powered by Drupal