Fix unknown variable error

This commit is contained in:
davidovski
2023-11-07 23:39:31 +00:00
parent 6c06afa902
commit 7ad3d9d581
+2 -2
View File
@@ -13,16 +13,16 @@ function printftext() {
// default to language "en"
$locale = "en";
if (array_key_exists("HTTP_ACCEPT_LANGUAGE", $_SERVER))
if (array_key_exists("HTTP_ACCEPT_LANGUAGE", $_SERVER)) {
$accept_language_header = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
if ($accept_language_header)
foreach(explode(",", explode(";", $accept_language_header)[0]) as $header_language) {
if (file_exists("locale/$header_language.php")) {
$locale = $header_language;
break;
}
}
}
define("TEXTS", require "locale/$locale.php");
?>