Add some comments on the language code normalization

This commit is contained in:
Sébastien Lucas 2015-02-06 20:55:32 +01:00
parent c5c9ffc3b0
commit 3b855b9e42

View file

@ -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);