Skip to content

Commit 3c14c66

Browse files
author
Marc Cámara
committed
Merge pull request mcamara#292 from okaufmann/master
fix if condition to not overwrite $locale
2 parents e305d2d + 202eef4 commit 3c14c66

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Mcamara/LaravelLocalization/Middleware/LocaleCookieRedirect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function handle( $request, Closure $next )
1717
$params = explode('/', $request->path());
1818
$locale = $request->cookie('locale', false);
1919

20-
if ( count($params) > 0 && $locale = app('laravellocalization')->checkLocaleInSupportedLocales($params[ 0 ]) )
20+
if ( count($params) > 0 && app('laravellocalization')->checkLocaleInSupportedLocales($params[ 0 ]) )
2121
{
2222
cookie('locale', $params[ 0 ]);
2323

src/Mcamara/LaravelLocalization/Middleware/LocaleSessionRedirect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function handle( $request, Closure $next )
1717
$params = explode('/', $request->path());
1818
$locale = session('locale', false);
1919

20-
if ( count($params) > 0 && $locale = app('laravellocalization')->checkLocaleInSupportedLocales($params[ 0 ]) )
20+
if ( count($params) > 0 && app('laravellocalization')->checkLocaleInSupportedLocales($params[ 0 ]) )
2121
{
2222
session([ 'locale' => $params[ 0 ] ]);
2323

0 commit comments

Comments
 (0)