Remember selected charset in cookie.

This commit is contained in:
Michal Čihař
2004-06-25 08:23:47 +00:00
parent a481a05ef8
commit 9c3c3104d4
3 changed files with 12 additions and 1 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2004-06-24 Michal Čihař <michal@cihar.com>
* main.php, libraries/select_lang.lib.php: Remember selected charset in
cookie.
2004-06-25 Alexander M. Turek <rabus@users.sourceforge.net>
* queryframe.php: Undefined index errors.

View File

@@ -296,7 +296,11 @@ if (empty($lang)) {
// 4. Checks whether charset recoding should be allowed or not
$allow_recoding = FALSE; // Default fallback value
if (!isset($convcharset) || empty($convcharset)) {
$convcharset = $cfg['DefaultCharset'];
if (isset($_COOKIE['pma_charset'])) {
$convcharset = $_COOKIE['pma_charset'];
} else {
$convcharset = $cfg['DefaultCharset'];
}
}
// 5. Defines the associated filename and load the translation

View File

@@ -19,6 +19,9 @@ if (!isset($pma_uri_parts)) {
$is_https = (isset($pma_uri_parts['scheme']) && $pma_uri_parts['scheme'] == 'https') ? 1 : 0;
}
setcookie('pma_lang', $lang, time() + 60*60*24*30, $cookie_path, '', $is_https);
if (isset($convcharset)) {
setcookie('pma_charset', $convcharset, time() + 60*60*24*30, $cookie_path, '', $is_https);
}
/**
* Includes the ThemeManager
*/