The branch, master has been updated via df4a6efe472599ba52afac169399d2a649414ced (commit) via 8ceb240551f1504a711544d6de123adbd36be351 (commit) via 4603f7e88170b3e5b2c72e16d56c9c3cffb69da6 (commit) via c9aa65668c7d3b2332748ca469e944ae68614e78 (commit) via 765e9021e48b52013bdc0d850b05c6ce490fffd0 (commit) from 857b1250e76068fd0713b1c657de901711b426c4 (commit)
- Log ----------------------------------------------------------------- commit df4a6efe472599ba52afac169399d2a649414ced Author: Michal Čihař mcihar@novell.com Date: Tue Jul 20 11:46:11 2010 +0200
Drop convcharset/pma_charset handling.
This code had no real use, it was used for converting strings from MySQL to browser encoding.
commit 8ceb240551f1504a711544d6de123adbd36be351 Author: Michal Čihař mcihar@novell.com Date: Tue Jul 20 11:43:10 2010 +0200
Drop passing of convcharset.
commit 4603f7e88170b3e5b2c72e16d56c9c3cffb69da6 Author: Michal Čihař mcihar@novell.com Date: Tue Jul 20 11:42:53 2010 +0200
This function is not used anywhere.
commit c9aa65668c7d3b2332748ca469e944ae68614e78 Author: Michal Čihař mcihar@novell.com Date: Tue Jul 20 11:42:38 2010 +0200
Fix comment.
commit 765e9021e48b52013bdc0d850b05c6ce490fffd0 Author: Michal Čihař mcihar@novell.com Date: Tue Jul 20 11:41:21 2010 +0200
No need to handle convcharset here.
-----------------------------------------------------------------------
Summary of changes: export.php | 6 +---- index.php | 2 +- libraries/charset_conversion.lib.php | 37 ---------------------------------- libraries/common.inc.php | 13 +---------- libraries/dbi/mysqli.dbi.lib.php | 2 - libraries/grab_globals.lib.php | 1 - libraries/select_lang.lib.php | 11 ---------- libraries/url_generating.lib.php | 10 --------- pdf_schema.php | 2 +- test/PMA_generateCommonUrl_test.php | 14 +------------ 10 files changed, 6 insertions(+), 92 deletions(-)
diff --git a/export.php b/export.php index 5d487a1..8476a52 100644 --- a/export.php +++ b/export.php @@ -262,11 +262,7 @@ if ($asfile) { }
// convert filename to iso-8859-1, it is safer - if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] )) { - $filename = PMA_convert_string($charset, 'iso-8859-1', $filename); - } else { - $filename = PMA_convert_string($convcharset, 'iso-8859-1', $filename); - } + $filename = PMA_convert_string($charset, 'iso-8859-1', $filename);
// Grab basic dump extension and mime type $filename .= '.' . $export_list[$type]['extension']; diff --git a/index.php b/index.php index d2d16fa..0b4a982 100644 --- a/index.php +++ b/index.php @@ -63,7 +63,7 @@ unset($cfgRelation); /** * pass variables to child pages */ -$drops = array('lang', 'server', 'convcharset', 'collation_connection', +$drops = array('lang', 'server', 'collation_connection', 'db', 'table');
foreach ($drops as $each_drop) { diff --git a/libraries/charset_conversion.lib.php b/libraries/charset_conversion.lib.php index dbcb4fd..ed44a64 100644 --- a/libraries/charset_conversion.lib.php +++ b/libraries/charset_conversion.lib.php @@ -121,43 +121,6 @@ if ($PMA_recoding_engine == PMA_CHARSET_ICONV_AIX) { }
/** - * Converts encoding of text according to current settings. - * - * @param string what to convert - * - * @return string converted text - * - * @global array the configuration array - * @global boolean whether recoding is allowed or not - * @global string the current charset - * @global array the charset to convert to - * - * @access public - * - */ -function PMA_convert_charset($what) { - global $cfg, $charset, $convcharset; - - if (!(isset($cfg['AllowAnywhereRecoding']) && $cfg['AllowAnywhereRecoding'] ) - || $convcharset == $charset) { // if input and output charset are the same, we don't have to do anything... - return $what; - } else { - switch ($GLOBALS['PMA_recoding_engine']) { - case PMA_CHARSET_RECODE: - return recode_string($charset . '..' . $convcharset, $what); - case PMA_CHARSET_ICONV: - return iconv($charset, $convcharset . $cfg['IconvExtraParams'], $what); - case PMA_CHARSET_ICONV_AIX: - return PMA_aix_iconv_wrapper($charset, $convcharset . $cfg['IconvExtraParams'], $what); - case PMA_CHARSET_LIBICONV: - return libiconv($charset, $convcharset . $GLOBALS['cfg']['IconvExtraParams'], $what); - default: - return $what; - } - } -} // end of the "PMA_convert_charset()" function - -/** * Converts encoding of text according to parameters with detected * conversion function. * diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 5366c18..8ad8a2c 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -454,7 +454,7 @@ if (PMA_checkPageValidity($_REQUEST['back'], $goto_whitelist)) { * f.e. PMA_Config: fontsize * * @todo variables should be handled by their respective owners (objects) - * f.e. lang, server, convcharset, collation_connection in PMA_Config + * f.e. lang, server, collation_connection in PMA_Config */ if (! PMA_isValid($_REQUEST['token']) || $_SESSION[' PMA_token '] != $_REQUEST['token']) { /** @@ -468,7 +468,7 @@ if (! PMA_isValid($_REQUEST['token']) || $_SESSION[' PMA_token '] != $_REQUEST[' /* Session ID */ 'phpMyAdmin', /* Cookie preferences */ - 'pma_lang', 'pma_charset', 'pma_collation_connection', + 'pma_lang', 'pma_collation_connection', /* Possible login form */ 'pma_servername', 'pma_username', 'pma_password', /* for playing blobstreamable media */ @@ -489,14 +489,6 @@ if (! PMA_isValid($_REQUEST['token']) || $_SESSION[' PMA_token '] != $_REQUEST['
/** - * @global string $GLOBALS['convcharset'] - * @see select_lang.lib.php - */ -if (isset($_REQUEST['convcharset'])) { - $GLOBALS['convcharset'] = strip_tags($_REQUEST['convcharset']); -} - -/** * current selected database * @global string $GLOBALS['db'] */ @@ -793,7 +785,6 @@ if (! defined('PMA_MINIMUM_COMMON')) { * @todo should be done in PMA_Config */ $GLOBALS['PMA_Config']->setCookie('pma_lang', $GLOBALS['lang']); - $GLOBALS['PMA_Config']->setCookie('pma_charset', $GLOBALS['convcharset']); $GLOBALS['PMA_Config']->setCookie('pma_collation_connection', $GLOBALS['collation_connection']);
$_SESSION['PMA_Theme_Manager']->setThemeCookie(); diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php index 2a59ed5..80779d8 100644 --- a/libraries/dbi/mysqli.dbi.lib.php +++ b/libraries/dbi/mysqli.dbi.lib.php @@ -144,7 +144,6 @@ function PMA_DBI_connect($user, $password, $is_controluser = false, $server = nu * selects given database * * @uses $GLOBALS['userlink'] - * @uses PMA_convert_charset() * @uses mysqli_select_db() * @param string $dbname database name to select * @param object mysqli $link the mysqli object @@ -168,7 +167,6 @@ function PMA_DBI_select_db($dbname, $link = null) * @uses PMA_DBI_QUERY_STORE * @uses PMA_DBI_QUERY_UNBUFFERED * @uses $GLOBALS['userlink'] - * @uses PMA_convert_charset() * @uses MYSQLI_STORE_RESULT * @uses MYSQLI_USE_RESULT * @uses mysqli_query() diff --git a/libraries/grab_globals.lib.php b/libraries/grab_globals.lib.php index 2b626da..a582e82 100644 --- a/libraries/grab_globals.lib.php +++ b/libraries/grab_globals.lib.php @@ -71,7 +71,6 @@ $_import_blacklist = array( '/^goto$/i', // page to display '/^back$/i', // the page go back '/^lang$/i', // selected language - '/^convcharset$/i', // PMA convert charset '/^collation_connection$/i', // '/^set_theme$/i', // '/^sql_query$/i', // the query to be executed diff --git a/libraries/select_lang.lib.php b/libraries/select_lang.lib.php index c39e2df..f4c0c1b 100644 --- a/libraries/select_lang.lib.php +++ b/libraries/select_lang.lib.php @@ -32,7 +32,6 @@ function PMA_langName($tmplang) { * @uses $GLOBALS['lang_failed_cfg'] * @uses $GLOBALS['lang_failed_cookie'] * @uses $GLOBALS['lang_failed_request'] - * @uses $GLOBALS['convcharset'] to set it if not set * @uses $_REQUEST['lang'] * @uses $_COOKIE['pma_lang'] * @uses $_SERVER['HTTP_ACCEPT_LANGUAGE'] @@ -444,16 +443,6 @@ $GLOBALS['mysql_charset_map'] = array( * Do the work! */
-if (empty($GLOBALS['convcharset'])) { - if (isset($_COOKIE['pma_charset'])) { - $GLOBALS['convcharset'] = $_COOKIE['pma_charset']; - } else { - // session.save_path might point to a bad folder, in which case - // $GLOBALS['cfg'] would not exist - $GLOBALS['convcharset'] = isset($GLOBALS['cfg']['DefaultCharset']) ? $GLOBALS['cfg']['DefaultCharset'] : 'utf-8'; - } -} - if (! PMA_langCheck()) { // fallback language $fall_back_lang = 'en'; diff --git a/libraries/url_generating.lib.php b/libraries/url_generating.lib.php index fddeb7e..ef5c7fa 100644 --- a/libraries/url_generating.lib.php +++ b/libraries/url_generating.lib.php @@ -57,10 +57,6 @@ function PMA_generate_common_hidden_inputs($db = '', $table = '', $indent = 0, $ && ! empty($GLOBALS['lang'])) { $params['lang'] = $GLOBALS['lang']; } - if (empty($_COOKIE['pma_charset']) - && ! empty($GLOBALS['convcharset'])) { - $params['convcharset'] = $GLOBALS['convcharset']; - } if (empty($_COOKIE['pma_collation_connection']) && ! empty($GLOBALS['collation_connection'])) { $params['collation_connection'] = $GLOBALS['collation_connection']; @@ -170,8 +166,6 @@ function PMA_getHiddenFields($values, $pre = '') * @uses $GLOBALS['cfg']['ServerDefault'] * @uses $_COOKIE['pma_lang'] * @uses $GLOBALS['lang'] - * @uses $_COOKIE['pma_charset'] - * @uses $GLOBALS['convcharset'] * @uses $_COOKIE['pma_collation_connection'] * @uses $GLOBALS['collation_connection'] * @uses $_SESSION[' PMA_token '] @@ -249,10 +243,6 @@ function PMA_generate_common_url() && ! empty($GLOBALS['lang'])) { $params['lang'] = $GLOBALS['lang']; } - if (empty($_COOKIE['pma_charset']) - && ! empty($GLOBALS['convcharset'])) { - $params['convcharset'] = $GLOBALS['convcharset']; - } if (empty($_COOKIE['pma_collation_connection']) && ! empty($GLOBALS['collation_connection'])) { $params['collation_connection'] = $GLOBALS['collation_connection']; diff --git a/pdf_schema.php b/pdf_schema.php index 598c9a4..43bffae 100644 --- a/pdf_schema.php +++ b/pdf_schema.php @@ -224,7 +224,7 @@ class PMA_PDF extends TCPDF { function PMA_PDF_die($error_message = '') { global $cfg; - global $server, $lang, $convcharset, $db; + global $server, $lang, $db; global $charset, $text_dir;
require_once './libraries/header.inc.php'; diff --git a/test/PMA_generateCommonUrl_test.php b/test/PMA_generateCommonUrl_test.php index 2d69574..8f62a82 100644 --- a/test/PMA_generateCommonUrl_test.php +++ b/test/PMA_generateCommonUrl_test.php @@ -21,14 +21,13 @@ class PMA_generate_common_url_test extends PHPUnit_Framework_TestCase { public function setUp() { - unset($_COOKIE['pma_lang'], $_COOKIE['pma_charset'], $_COOKIE['pma_collation_connection']); + unset($_COOKIE['pma_lang'], $_COOKIE['pma_collation_connection']); }
public function testOldStyle() { $GLOBALS['server'] = 'x'; $GLOBALS['lang'] = 'x'; - $GLOBALS['convcharset'] = 'x'; $GLOBALS['collation_connection'] = 'x'; $_SESSION[' PMA_token '] = 'x'; $GLOBALS['cfg']['ServerDefault'] = 'y'; @@ -36,7 +35,6 @@ class PMA_generate_common_url_test extends PHPUnit_Framework_TestCase $separator = PMA_get_arg_separator(); $expected = 'server=x' . htmlentities($separator) . 'lang=x' . htmlentities($separator) - . 'convcharset=x' . htmlentities($separator) . 'collation_connection=x' . htmlentities($separator) . 'token=x' ; @@ -52,7 +50,6 @@ class PMA_generate_common_url_test extends PHPUnit_Framework_TestCase { $GLOBALS['server'] = 'x'; $GLOBALS['lang'] = 'x'; - $GLOBALS['convcharset'] = 'x'; $GLOBALS['collation_connection'] = 'x'; $_SESSION[' PMA_token '] = 'x'; $GLOBALS['cfg']['ServerDefault'] = 'y'; @@ -60,7 +57,6 @@ class PMA_generate_common_url_test extends PHPUnit_Framework_TestCase $separator = PMA_get_arg_separator(); $expected = 'server=x' . htmlentities($separator) . 'lang=x' . htmlentities($separator) - . 'convcharset=x' . htmlentities($separator) . 'collation_connection=x' . htmlentities($separator) . 'token=x' ; @@ -75,7 +71,6 @@ class PMA_generate_common_url_test extends PHPUnit_Framework_TestCase { $GLOBALS['server'] = 'x'; $GLOBALS['lang'] = 'x'; - $GLOBALS['convcharset'] = 'x'; $GLOBALS['collation_connection'] = 'x'; $_SESSION[' PMA_token '] = 'x'; $GLOBALS['cfg']['ServerDefault'] = 'y'; @@ -83,7 +78,6 @@ class PMA_generate_common_url_test extends PHPUnit_Framework_TestCase $separator = PMA_get_arg_separator(); $expected = 'server=x' . htmlentities($separator) . 'lang=x' . htmlentities($separator) - . 'convcharset=x' . htmlentities($separator) . 'collation_connection=x' . htmlentities($separator) . 'token=x' ; @@ -99,7 +93,6 @@ class PMA_generate_common_url_test extends PHPUnit_Framework_TestCase { $GLOBALS['server'] = 'x'; $GLOBALS['lang'] = 'x'; - $GLOBALS['convcharset'] = 'x'; $GLOBALS['collation_connection'] = 'x'; $_SESSION[' PMA_token '] = 'x'; $GLOBALS['cfg']['ServerDefault'] = 'y'; @@ -107,7 +100,6 @@ class PMA_generate_common_url_test extends PHPUnit_Framework_TestCase $separator = PMA_get_arg_separator(); $expected = 'server=x' . $separator . 'lang=x' . $separator - . 'convcharset=x' . $separator . 'collation_connection=x' . $separator . 'token=x' ; @@ -120,7 +112,6 @@ class PMA_generate_common_url_test extends PHPUnit_Framework_TestCase { $GLOBALS['server'] = 'x'; $GLOBALS['lang'] = 'x'; - $GLOBALS['convcharset'] = 'x'; $GLOBALS['collation_connection'] = 'x'; $_SESSION[' PMA_token '] = 'x'; $GLOBALS['cfg']['ServerDefault'] = 'y'; @@ -128,7 +119,6 @@ class PMA_generate_common_url_test extends PHPUnit_Framework_TestCase $separator = PMA_get_arg_separator(); $expected = 'server=x' . $separator . 'lang=x' . $separator - . 'convcharset=x' . $separator . 'collation_connection=x' . $separator . 'token=x' ; @@ -141,7 +131,6 @@ class PMA_generate_common_url_test extends PHPUnit_Framework_TestCase { $GLOBALS['server'] = 'x'; $GLOBALS['lang'] = 'x'; - $GLOBALS['convcharset'] = 'x'; $GLOBALS['collation_connection'] = 'x'; $_SESSION[' PMA_token '] = 'x'; $GLOBALS['cfg']['ServerDefault'] = 'y'; @@ -149,7 +138,6 @@ class PMA_generate_common_url_test extends PHPUnit_Framework_TestCase $separator = PMA_get_arg_separator(); $expected = 'server=x' . htmlentities($separator) . 'lang=x' . htmlentities($separator) - . 'convcharset=x' . htmlentities($separator) . 'collation_connection=x' . htmlentities($separator) . 'token=x' ;
hooks/post-receive