From ad774a16988f9f86e1013a4737bbbd1953cc49b1 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 4 Sep 2004 12:32:05 +0000 Subject: [PATCH] bug 1009791 remove non-UTF-8 choices --- ChangeLog | 12 +++++++----- libraries/database_interface.lib.php | 13 +++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 472f12da1..7a033a1f0 100755 --- a/ChangeLog +++ b/ChangeLog @@ -6,7 +6,9 @@ $Id$ $Source$ 2004-09-04 Marc Delisle - * sql.php: bug 899430: left frame problem when lower_case_table_names==2 + * sql.php: bug #899430: left frame problem when lower_case_table_names==2 + * libraries/database_interface.lib.php: bug #1009791: now remove non-UTF-8 + choices from the drop-down (in main) for MySQL 4.1.x 2004-09-03 Marc Delisle * main.php, server_privileges.php, libraries/common.lib.php: @@ -20,7 +22,7 @@ $Source$ versions 4.1.0 and 4.1.1. 2004-09-01 Marc Delisle - * libraries/auth/cookie.auth.lib.php: bug 939531: when people upgrade + * libraries/auth/cookie.auth.lib.php: bug #939531: when people upgrade phpMyAdmin on the same directory, the previous cookie pma_cookie_username was used but produced an Undefined offset in blowfish.php, because on previous PMA versions it was not encoded the same way. Now this old @@ -31,7 +33,7 @@ $Source$ * libraries/export/sql.php: Fix empty BLOB export (bug #1020052). 2004-08-29 Marc Delisle - * server_privileges.php: bug 1007870, illegal mix of collations + * server_privileges.php: bug #1007870, illegal mix of collations for operation UNION 2004-08-28 Marc Delisle @@ -40,11 +42,11 @@ $Source$ support for VARBINARY and BINARY field types 2004-08-27 Marc Delisle - * tbl_relation.php, libraries/display_tbl.lib.php: bug 1016997, + * tbl_relation.php, libraries/display_tbl.lib.php: bug #1016997, wrong db name generated in SHOW KEYS 2004-08-26 Marc Delisle - * index.php, libraries/common.lib.php: bug 1006011: now we save + * index.php, libraries/common.lib.php: bug #1006011: now we save the chosen connection collation into a cookie * lang/japanese: updated, thanks to Tadashi Jokagi (elf2000) * lang/hebrew, turkish: bug 1016609:
tags diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 835649142..dba00f5c9 100644 --- a/libraries/database_interface.lib.php +++ b/libraries/database_interface.lib.php @@ -145,6 +145,19 @@ function PMA_DBI_postConnect($link) { } } + // and we remove the non-UTF-8 choices to avoid confusion + if (!defined('PMA_REMOVED_NON_UTF_8')) { + $tmp_available_languages = $GLOBALS['available_languages']; + $GLOBALS['available_languages'] = array(); + foreach ($tmp_available_languages AS $tmp_lang => $tmp_lang_data) { + if (substr($tmp_lang, -5) == 'utf-8') { + $GLOBALS['available_languages'][$tmp_lang] = $tmp_lang_data; + } + } // end foreach + unset($tmp_lang, $tmp_lang_data, $tmp_available_languages); + define('PMA_REMOVED_NON_UTF_8',1); + } + $mysql_charset = $GLOBALS['mysql_charset_map'][$GLOBALS['charset']]; if (empty($collation_connection) || (strpos('_', $collation_connection) ? substr($collation_connection, 0, strpos('_', $collation_connection)) : $collation_connection) == $mysql_charset) { PMA_DBI_query('SET NAMES ' . $mysql_charset . ';', $link, PMA_DBI_QUERY_STORE);