Fix undefined array key "HTTP_ACCEPT_LANGUAGE"

This commit is contained in:
Jay Trees 2022-04-12 13:17:01 +02:00
parent 431fb6dd22
commit 9580983bf2

View file

@ -35,7 +35,9 @@ class User
$this->id = $id;
}
$this->locale = \Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
$this->locale = \Locale::acceptFromHttp(
$_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? DEFAULT_LOCALE
);
if (!isset($this->id)) {
return null;