Permalink
Browse files

make it possible to configure the useReferrer via the attributes

  • Loading branch information...
lsmith77 committed Oct 27, 2012
1 parent 7caf98f commit 5e8a06c62af9bc5d0924ea05bc39772054b718e0
Showing with 2 additions and 1 deletion.
  1. +2 −1 Controller/LocaleController.php
@@ -56,6 +56,7 @@ public function switchAction(Request $request)
{
$_locale = $request->attributes->get('_locale', $request->getLocale());
$statusCode = $request->attributes->get('statusCode', $this->statusCode);
+ $useReferrer = $request->attributes->get('useReferrer', $this->useReferrer);
$redirectToRoute = $request->attributes->get('route', $this->redirectToRoute);
$metaValidator = $this->metaValidator;
@@ -64,7 +65,7 @@ public function switchAction(Request $request)
}
// Redirect the User
- if ($this->useReferrer && $request->headers->has('referer')) {
+ if ($useReferrer && $request->headers->has('referer')) {
$response = new RedirectResponse($request->headers->get('referer'), $statusCode);
} elseif ($this->router && $redirectToRoute) {
$response = new RedirectResponse($this->router->generate($redirectToRoute, array('_locale' => $_locale)), $statusCode);

0 comments on commit 5e8a06c

Please sign in to comment.