Skip to content

Commit

Permalink
use a request attribute flag for redirection profile
Browse files Browse the repository at this point in the history
  • Loading branch information
HeahDude committed Apr 23, 2016
1 parent b26cb6d commit df19c14
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,8 @@ public function collect(Request $request, Response $response, \Exception $except
}

if (isset($session)) {
if ($session->has('sf_redirected')) {
$this->data['redirect'] = $session->get('sf_redirect');
$session->remove('sf_redirect');
$session->remove('sf_redirected');
if ($request->attributes->has('_redirected')) {
$this->data['redirect'] = $session->remove('sf_redirect');
}

if ($response->isRedirect()) {
Expand Down Expand Up @@ -297,7 +295,7 @@ public function onKernelResponse(FilterResponseEvent $event)
}

if ($event->getRequest()->getSession()->has('sf_redirect')) {
$event->getRequest()->getSession()->set('sf_redirected', true);
$event->getRequest()->attributes->set('_redirected', true);
}
}

Expand Down

0 comments on commit df19c14

Please sign in to comment.