SecuredRedirectResponse
abstract class SecuredRedirectResponse extends RedirectResponse (View source)
Provides a common base class for safe redirects.
In case you want to redirect to external URLs use TrustedRedirectResponse.
For local URLs we use LocalRedirectResponse which opts out of external redirects.
Methods
Copies an existing redirect response into a safe one.
Copies over the values from the given response.
{@inheritdoc}
Returns whether the URL is considered as safe to redirect to.
Details
static SecuredRedirectResponse
createFromRedirectResponse(RedirectResponse $response)
Copies an existing redirect response into a safe one.
The safe one cannot accidentally redirect to an external URL, unless actively wanted (see TrustedRedirectResponse).
protected
fromResponse(RedirectResponse $response)
Copies over the values from the given response.
setTargetUrl($url)
{@inheritdoc}
abstract protected bool
isSafe(string $url)
Returns whether the URL is considered as safe to redirect to.