mirror of
https://github.com/vrana/adminer.git
synced 2025-08-13 01:54:00 +02:00
Allow _ in Accept-Language
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@309 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -44,9 +44,9 @@ if (isset($langs[$_COOKIE["lang"]])) {
|
||||
$LANG = $_SESSION["lang"];
|
||||
} else {
|
||||
$accept_language = array();
|
||||
preg_match_all('~([-a-z]+)(;q=([0-9.]+))?~', strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"]), $matches, PREG_SET_ORDER);
|
||||
preg_match_all('~([-a-z_]+)(;q=([0-9.]+))?~', strtolower($_SERVER["HTTP_ACCEPT_LANGUAGE"]), $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $match) {
|
||||
$accept_language[$match[1]] = (isset($match[3]) ? $match[3] : 1);
|
||||
$accept_language[str_replace("_", "-", $match[1])] = (isset($match[3]) ? $match[3] : 1);
|
||||
}
|
||||
arsort($accept_language);
|
||||
$LANG = "en";
|
||||
|
Reference in New Issue
Block a user