mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
add isset for HTTP_ACCEPT_LANGUAGE
This commit is contained in:
parent
81d318d5d8
commit
5ac2789a27
@ -16,7 +16,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
//Auto Language Switcher
|
||||
view()->composer('*', function ($view) {
|
||||
if (config('advs.lang_switcher_for_browser') and is_null(Request()->session()->get('_locale'))) {
|
||||
if (config('advs.lang_switcher_for_browser') and is_null(Request()->session()->get('_locale')) and isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
||||
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);//Get Browser Language
|
||||
$acceptLang = config('streams::locales.enabled'); //Supported Language
|
||||
$lang = in_array($lang, $acceptLang) ? $lang : config('streams::locales.default', 'en');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user