* Prevent "Undefined index" notice #68 * Update Lang.php
This commit is contained in:
parent
98fe1dabfc
commit
33e8223222
|
@ -58,7 +58,11 @@ class Lang
|
|||
*/
|
||||
public static function recognize()
|
||||
{
|
||||
return locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
||||
return locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||
} else {
|
||||
return self::DEFAULT_LANG;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -133,4 +137,4 @@ class Lang
|
|||
|
||||
return $key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue