Fixed errors

This commit is contained in:
Rooty 2021-09-23 03:26:12 +02:00
parent 9ba0d58ba3
commit 3e87fa4a22

View File

@ -91,24 +91,23 @@ function check_lang($filelang="")
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
{ {
$accept_lang_array = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); // $accept_lang_array = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
for ($i = 0; $i < sizeof($accept_lang_array); $i++) // for ($i = 0; $i < sizeof($accept_lang_array); $i++)
{ // {
@reset($match_lang); // @reset($match_lang);
// while (list($lang, $match) = each($match_lang)) // foreach($match_lang as $lang => $match)
foreach($match_lang as $lang => $match) // {
{ // if (preg_match('#' . $match . '#i', trim($accept_lang_array[$i])))
if (preg_match('#' . $match . '#i', trim($accept_lang_array[$i]))) // {
{
// if (file_exists(($QWARE_ROOT_PATH . 'data/message/' . $lang."/".$filetest))) // if (file_exists(($QWARE_ROOT_PATH . 'data/message/' . $lang."/".$filetest)))
if (file_exists(($QWARE_ROOT_PATH . "data/message/fr_FR-utf8/".$filelang))) if (file_exists(($QWARE_ROOT_PATH . "data/message/fr_FR-utf8/".$filelang)))
{ {
// return $lang."/"; // return $lang."/";
return "fr_FR-utf8/"; return "fr_FR-utf8/";
} }
} // }
} // }
} // }
} }
return 'FR'; return 'FR';
} }