Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make it possible to configure the useReferrer via the attributes

  • Loading branch information...
commit 5e8a06c62af9bc5d0924ea05bc39772054b718e0 1 parent 7caf98f
@lsmith77 lsmith77 authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  Controller/LocaleController.php
View
3  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);
Please sign in to comment.
Something went wrong with that request. Please try again.