Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mcamara/laravel-localization
Browse files Browse the repository at this point in the history
  • Loading branch information
mcamara committed Nov 15, 2015
2 parents 3b0da23 + 250abff commit bf2d8f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Mcamara/LaravelLocalization/LanguageNegotiator.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function negotiateLanguage()
{
reset($this->supportedLanguages);

return key($array);
return key($this->supportedLanguages);
}

if ( class_exists('Locale') && !empty( $_SERVER[ 'HTTP_ACCEPT_LANGUAGE' ] ) )
Expand Down Expand Up @@ -154,4 +154,4 @@ private function getMatchesFromAcceptedLanguages()

return $matches;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function handle( $request, Closure $next )

$locale = session('locale', false);

if ( $locale && !( app('laravellocalization')->getDefaultLocale() === $locale && app('laravellocalization')->hideDefaultLocaleInURL() ) )
if ( $locale && app('laravellocalization')->checkLocaleInSupportedLocales($locale) && !( app('laravellocalization')->getDefaultLocale() === $locale && app('laravellocalization')->hideDefaultLocaleInURL() ) )
{
app('session')->reflash();
$redirection = app('laravellocalization')->getLocalizedURL($locale);
Expand All @@ -36,4 +36,4 @@ public function handle( $request, Closure $next )

return $next($request);
}
}
}

0 comments on commit bf2d8f4

Please sign in to comment.