isSafe example

// Cookies are separate from other headers and have to be copied over     // directly.     foreach ($response->headers->getCookies() as $cookie) {
      $this->headers->setCookie($cookie);
    }
  }

  /** * {@inheritdoc} */
  public function setTargetUrl($url)static {
    if (!$this->isSafe($url)) {
      throw new \InvalidArgumentException(sprintf('It is not safe to redirect to %s', $url));
    }
    return parent::setTargetUrl($url);
  }

  /** * Returns whether the URL is considered as safe to redirect to. * * @param string $url * The URL checked for safety. * * @return bool */
Home | Imprint | This part of the site doesn't use cookies.