function StreamWrapperManager::isValidUri

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php \Drupal\Core\StreamWrapper\StreamWrapperManager::isValidUri()
  2. 10 core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php \Drupal\Core\StreamWrapper\StreamWrapperManager::isValidUri()
  3. 11.x core/lib/Drupal/Core/StreamWrapper/StreamWrapperManager.php \Drupal\Core\StreamWrapper\StreamWrapperManager::isValidUri()

Determines whether the URI has a valid scheme for file API operations.

There must be a scheme and it must be a Drupal-provided scheme like 'public', 'private', 'temporary', or an extension provided with hook_stream_wrappers().

Parameters

string $uri: The URI to be tested.

Return value

bool TRUE if the URI is valid.

Overrides StreamWrapperManagerInterface::isValidUri

File

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

Class

StreamWrapperManager
Provides a StreamWrapper manager.

Namespace

Drupal\Core\StreamWrapper

Code

public function isValidUri($uri) {
    // Assert that the URI has an allowed scheme. Bare paths are not allowed.
    return $this->isValidScheme($this->getScheme($uri));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.