mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Localization: If browser does not send the Accept-Language header the page crashes. Now it's not
This commit is contained in:
parent
9578759f17
commit
a3ea846390
1 changed files with 2 additions and 1 deletions
|
@ -117,7 +117,8 @@ function isLanguageAvailable($lg): bool
|
|||
|
||||
function getBrowsersLanguage(): array
|
||||
{
|
||||
return mb_split(",", mb_split(";", $_SERVER['HTTP_ACCEPT_LANGUAGE'])[0]);
|
||||
if ($_SERVER['HTTP_ACCEPT_LANGUAGE'] != null) return mb_split(",", mb_split(";", $_SERVER['HTTP_ACCEPT_LANGUAGE'])[0]);
|
||||
else return array();
|
||||
}
|
||||
|
||||
function eventdb(): ?DatabaseConnection
|
||||
|
|
Loading…
Reference in a new issue