public function SecuredRedirectResponse::setTargetUrl in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Component/HttpFoundation/SecuredRedirectResponse.php \Drupal\Component\HttpFoundation\SecuredRedirectResponse::setTargetUrl()
Sets the redirect target of this response.
Parameters
string $url The URL to redirect to:
Return value
RedirectResponse The current response.
Throws
\InvalidArgumentException
Overrides RedirectResponse::setTargetUrl
1 call to SecuredRedirectResponse::setTargetUrl()
- TrustedRedirectResponse::setTrustedTargetUrl in core/
lib/ Drupal/ Core/ Routing/ TrustedRedirectResponse.php - Sets the target URL to a trusted URL.
File
- core/
lib/ Drupal/ Component/ HttpFoundation/ SecuredRedirectResponse.php, line 59 - Contains \Drupal\Component\HttpFoundation\SecuredRedirectResponse.
Class
- SecuredRedirectResponse
- Provides a common base class for safe redirects.
Namespace
Drupal\Component\HttpFoundationCode
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);
}