public SecuredRedirectResponse::setTargetUrl($url)
Sets the redirect target of this response.
string $url The URL to redirect to:
RedirectResponse The current response.
\InvalidArgumentException
Overrides RedirectResponse::setTargetUrl
public function setTargetUrl($url) { if (!$this->isSafe($url)) { throw new \InvalidArgumentException(sprintf('It is not safe to redirect to %s', $url)); } return parent::setTargetUrl($url); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!HttpFoundation!SecuredRedirectResponse.php/function/SecuredRedirectResponse::setTargetUrl/8.1.x