public 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).
\Symfony\Component\HttpFoundation\RedirectResponse $response: The original redirect.
static
public static function createFromRedirectResponse(RedirectResponse $response) { $safe_response = new static($response->getTargetUrl(), $response->getStatusCode(), $response->headers->allPreserveCase()); $safe_response->fromResponse($response); return $safe_response; }
© 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::createFromRedirectResponse/8.1.x