Add some comments on the language code normalization
This commit is contained in:
parent
c5c9ffc3b0
commit
3b855b9e42
1
base.php
1
base.php
|
@ -207,6 +207,7 @@ function getAcceptLanguages() {
|
||||||
if (count($lang_parse[1])) {
|
if (count($lang_parse[1])) {
|
||||||
$langs = array();
|
$langs = array();
|
||||||
foreach ($lang_parse[1] as $lang) {
|
foreach ($lang_parse[1] as $lang) {
|
||||||
|
// Format the language code (not standard among browsers)
|
||||||
if (strlen($lang) == 5) {
|
if (strlen($lang) == 5) {
|
||||||
$lang = str_replace("-", "_", $lang);
|
$lang = str_replace("-", "_", $lang);
|
||||||
$splitted = preg_split("/_/", $lang);
|
$splitted = preg_split("/_/", $lang);
|
||||||
|
|
Loading…
Reference in a new issue