Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Store lang in session too

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@276 7c3ca157-0c34-0410-bff1-cbf682f78f5c
  • Loading branch information...
commit ea1bb7dd5b6de7513e23c8d7a022e8c1f10e1cdd 1 parent a9b0320
jakubvrana authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lang.inc.php
View
5 lang.inc.php
@@ -34,10 +34,13 @@ function switch_lang() {
if (isset($_GET["lang"])) {
setcookie("lang", $_GET["lang"], strtotime("+1 month"), preg_replace('~\\?.*~', '', $_SERVER["REQUEST_URI"]));
$_COOKIE["lang"] = $_GET["lang"];
+ $_SESSION["lang"] = $_GET["lang"];
}
-if (strlen($_COOKIE["lang"]) && isset($translations[$_COOKIE["lang"]])) {
+if (isset($translations[$_COOKIE["lang"]])) {
$LANG = $_COOKIE["lang"];
+} elseif (isset($translations[$_SESSION["lang"]])) {
+ $LANG = $_SESSION["lang"];
} else {
$accept_language = array();
preg_match_all('~([-a-z]+)(;q=([0-9.]+))?~', $_SERVER["HTTP_ACCEPT_LANGUAGE"], $matches, PREG_SET_ORDER);
Please sign in to comment.
Something went wrong with that request. Please try again.