Open mark0263 opened 2 years ago
When loading the site - the subject error hits. Appears to only happen on PHP v8+ sites. The code below will resolve the issue by validating $_CONF['language_files'] is actually an array that is set.
function COM_getLanguageFromBrowser() { global $_CONF; $retval = ''; if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $accept = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); foreach ($accept as $l) { $l = explode(';', trim($l)); $l = $l[0]; if (is_array($_CONF['language_files']) && @array_key_exists($l, $_CONF['language_files'])) { $retval = $_CONF['language_files'][$l]; break; } else { $l = explode('-', $l); $l = $l[0]; if (is_array($_CONF['language_files']) && @array_key_exists($l, $_CONF['language_files'])) { $retval = $_CONF['language_files'][$l]; break; } } } } return $retval; }
When loading the site - the subject error hits. Appears to only happen on PHP v8+ sites. The code below will resolve the issue by validating $_CONF['language_files'] is actually an array that is set.