You are here

protected function LocalAwareRedirectResponseTrait::isLocal in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Routing/LocalAwareRedirectResponseTrait.php \Drupal\Core\Routing\LocalAwareRedirectResponseTrait::isLocal()
1 call to LocalAwareRedirectResponseTrait::isLocal()
TrustedRedirectResponse::isSafe in core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php
Returns whether the URL is considered as safe to redirect to.

File

core/lib/Drupal/Core/Routing/LocalAwareRedirectResponseTrait.php, line 27
Contains \Drupal\Core\Routing\LocalAwareRedirectResponseTrait.

Class

LocalAwareRedirectResponseTrait
Provides a trait which ensures that a URL is safe to redirect to.

Namespace

Drupal\Core\Routing

Code

protected function isLocal($url) {
  return !UrlHelper::isExternal($url) || UrlHelper::externalIsLocal($url, $this
    ->getRequestContext()
    ->getCompleteBaseUrl());
}