Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
This commit is contained in:
@@ -87,6 +87,8 @@ $Id$
|
||||
thanks to Piotr Przybylski - crackpl
|
||||
- bug [password] Generate password only available if JS is enabled
|
||||
(fixed for Privileges and Change password)
|
||||
- [core] RecodingEngine now accepts none as valid option.
|
||||
+ [core] Dropped AllowAnywhereRecoding configuration variable.
|
||||
|
||||
3.3.6.0 (not yet released)
|
||||
|
||||
|
@@ -1703,18 +1703,6 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE</pre>
|
||||
expression. For example if you want only Czech and English, you should
|
||||
set filter to <code>'^(cs|en)'</code>.</dd>
|
||||
|
||||
<dt id="cfg_AllowAnywhereRecoding">$cfg['AllowAnywhereRecoding'] boolean</dt>
|
||||
<dd>Allow character set recoding of MySQL queries. You need recode or iconv
|
||||
support (compiled in or module) in PHP to allow MySQL queries recoding
|
||||
and used language file must have it enabled (by default only these
|
||||
which are in Unicode, just to avoid losing some characters).<br /><br />
|
||||
|
||||
Setting this to <tt>TRUE</tt> also activates a pull-down menu
|
||||
in the Export and Import pages, to choose the character set when
|
||||
exporting a file. The default value in this menu comes from
|
||||
<tt>$cfg['Export']['charset']</tt> and <tt>$cfg['Import']['charset']</tt>.
|
||||
</dd>
|
||||
|
||||
<dt id="cfg_RecodingEngine">$cfg['RecodingEngine'] string</dt>
|
||||
<dd>You can select here which functions will be used for character set
|
||||
conversion. Possible values are:
|
||||
@@ -1722,8 +1710,15 @@ CREATE DATABASE,ALTER DATABASE,DROP DATABASE</pre>
|
||||
iconv, then recode)</li>
|
||||
<li>iconv - use iconv or libiconv functions</li>
|
||||
<li>recode - use recode_string function</li>
|
||||
<li>none - disable encoding conversion</li>
|
||||
</ul>
|
||||
Default is auto.</dd>
|
||||
<dd>
|
||||
Enabled charset conversion activates a pull-down menu
|
||||
in the Export and Import pages, to choose the character set when
|
||||
exporting a file. The default value in this menu comes from
|
||||
<tt>$cfg['Export']['charset']</tt> and <tt>$cfg['Import']['charset']</tt>.
|
||||
</dd>
|
||||
|
||||
<dt id="cfg_IconvExtraParams">$cfg['IconvExtraParams'] string</dt>
|
||||
<dd>Specify some parameters for iconv used in charset conversion. See
|
||||
|
@@ -207,7 +207,7 @@ if ($what == 'sql') {
|
||||
$output_kanji_conversion = function_exists('PMA_kanji_str_conv') && $type != 'xls';
|
||||
|
||||
// Do we need to convert charset?
|
||||
$output_charset_conversion = $asfile && $cfg['AllowAnywhereRecoding']
|
||||
$output_charset_conversion = $asfile && $GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE
|
||||
&& isset($charset_of_file) && $charset_of_file != $charset
|
||||
&& $type != 'xls';
|
||||
|
||||
|
@@ -343,7 +343,7 @@ if ($import_file != 'none' && !$error) {
|
||||
//$_SESSION['Import_message'] = $message->getDisplay();
|
||||
|
||||
// Convert the file's charset if necessary
|
||||
if ($cfg['AllowAnywhereRecoding'] && isset($charset_of_file)) {
|
||||
if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE && isset($charset_of_file)) {
|
||||
if ($charset_of_file != $charset) {
|
||||
$charset_conversion = TRUE;
|
||||
}
|
||||
@@ -451,7 +451,7 @@ if (isset($my_die)) {
|
||||
if (! empty($last_query_with_results)) {
|
||||
// but we want to show intermediate results too
|
||||
$disp_query = $sql_query;
|
||||
$disp_message = __('Your SQL query has been executed successfully');
|
||||
$disp_message = __('Your SQL query has been executed successfully');
|
||||
$sql_query = $last_query_with_results;
|
||||
$go_sql = true;
|
||||
}
|
||||
|
@@ -10,109 +10,44 @@ if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Failure on loading recode/iconv extensions.
|
||||
*/
|
||||
function PMA_failRecoding() {
|
||||
PMA_fatalError(__('Couldn\'t load the iconv or recode extension needed for charset conversion. Either configure PHP to enable these extensions or disable charset conversion in phpMyAdmin.'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the recode or iconv extensions if any of it is not loaded yet
|
||||
*/
|
||||
if (isset($cfg['AllowAnywhereRecoding'])
|
||||
&& $cfg['AllowAnywhereRecoding']) {
|
||||
|
||||
if ($cfg['RecodingEngine'] == 'recode') {
|
||||
if (!@extension_loaded('recode')) {
|
||||
PMA_failRecoding();
|
||||
}
|
||||
$PMA_recoding_engine = 'recode';
|
||||
} elseif ($cfg['RecodingEngine'] == 'iconv') {
|
||||
if (!@extension_loaded('iconv')) {
|
||||
PMA_failRecoding();
|
||||
}
|
||||
$PMA_recoding_engine = 'iconv';
|
||||
} else {
|
||||
if (@extension_loaded('iconv')) {
|
||||
$PMA_recoding_engine = 'iconv';
|
||||
} elseif (@extension_loaded('recode')) {
|
||||
$PMA_recoding_engine = 'recode';
|
||||
} else {
|
||||
PMA_failRecoding();
|
||||
}
|
||||
}
|
||||
} // end load recode/iconv extension
|
||||
|
||||
define('PMA_CHARSET_NONE', 0);
|
||||
define('PMA_CHARSET_ICONV', 1);
|
||||
define('PMA_CHARSET_LIBICONV', 2);
|
||||
define('PMA_CHARSET_RECODE', 3);
|
||||
define('PMA_CHARSET_ICONV_AIX', 4);
|
||||
|
||||
if (!isset($cfg['IconvExtraParams'])) {
|
||||
$cfg['IconvExtraParams'] = '';
|
||||
}
|
||||
define('PMA_CHARSET_RECODE', 2);
|
||||
define('PMA_CHARSET_ICONV_AIX', 3);
|
||||
|
||||
// Finally detect which function we will use:
|
||||
if (isset($cfg['AllowAnywhereRecoding'])
|
||||
&& $cfg['AllowAnywhereRecoding']) {
|
||||
|
||||
if (!isset($PMA_recoding_engine)) {
|
||||
$PMA_recoding_engine = $cfg['RecodingEngine'];
|
||||
}
|
||||
if ($PMA_recoding_engine == 'iconv') {
|
||||
if (@function_exists('iconv')) {
|
||||
if ((@stristr(PHP_OS, 'AIX')) && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) && (@strcasecmp(ICONV_VERSION, 'unknown') == 0)) {
|
||||
$PMA_recoding_engine = PMA_CHARSET_ICONV_AIX;
|
||||
} else {
|
||||
$PMA_recoding_engine = PMA_CHARSET_ICONV;
|
||||
}
|
||||
} elseif (@function_exists('libiconv')) {
|
||||
$PMA_recoding_engine = PMA_CHARSET_LIBICONV;
|
||||
if ($cfg['RecodingEngine'] == 'iconv') {
|
||||
if (@function_exists('iconv')) {
|
||||
if ((@stristr(PHP_OS, 'AIX')) && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) && (@strcasecmp(ICONV_VERSION, 'unknown') == 0)) {
|
||||
$PMA_recoding_engine = PMA_CHARSET_ICONV_AIX;
|
||||
} else {
|
||||
$PMA_recoding_engine = PMA_CHARSET_NONE;
|
||||
|
||||
if (!isset($GLOBALS['is_header_sent'])) {
|
||||
include './libraries/header.inc.php';
|
||||
}
|
||||
echo __('Couldn\'t use the iconv, libiconv, or recode_string functions, although the necessary extensions appear to be loaded. Check your PHP configuration.');
|
||||
require_once './libraries/footer.inc.php';
|
||||
exit();
|
||||
}
|
||||
} elseif ($PMA_recoding_engine == 'recode') {
|
||||
if (@function_exists('recode_string')) {
|
||||
$PMA_recoding_engine = PMA_CHARSET_RECODE;
|
||||
} else {
|
||||
$PMA_recoding_engine = PMA_CHARSET_NONE;
|
||||
|
||||
require_once './libraries/header.inc.php';
|
||||
echo __('Couldn\'t use the iconv, libiconv, or recode_string functions, although the necessary extensions appear to be loaded. Check your PHP configuration.');
|
||||
require_once './libraries/footer.inc.php';
|
||||
exit;
|
||||
$PMA_recoding_engine = PMA_CHARSET_ICONV;
|
||||
}
|
||||
} else {
|
||||
if (@function_exists('iconv')) {
|
||||
if ((@stristr(PHP_OS, 'AIX')) && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) && (@strcasecmp(ICONV_VERSION, 'unknown') == 0)) {
|
||||
$PMA_recoding_engine = PMA_CHARSET_ICONV_AIX;
|
||||
} else {
|
||||
$PMA_recoding_engine = PMA_CHARSET_ICONV;
|
||||
}
|
||||
} elseif (@function_exists('libiconv')) {
|
||||
$PMA_recoding_engine = PMA_CHARSET_LIBICONV;
|
||||
} elseif (@function_exists('recode_string')) {
|
||||
$PMA_recoding_engine = PMA_CHARSET_RECODE;
|
||||
$PMA_recoding_engine = PMA_CHARSET_NONE;
|
||||
PMA_warnMissingExtension('iconv');
|
||||
}
|
||||
} elseif ($cfg['RecodingEngine'] == 'recode') {
|
||||
if (@function_exists('recode_string')) {
|
||||
$PMA_recoding_engine = PMA_CHARSET_RECODE;
|
||||
} else {
|
||||
$PMA_recoding_engine = PMA_CHARSET_NONE;
|
||||
PMA_warnMissingExtension('recode');
|
||||
}
|
||||
} elseif ($cfg['RecodingEngine'] == 'auto') {
|
||||
if (@function_exists('iconv')) {
|
||||
if ((@stristr(PHP_OS, 'AIX')) && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) && (@strcasecmp(ICONV_VERSION, 'unknown') == 0)) {
|
||||
$PMA_recoding_engine = PMA_CHARSET_ICONV_AIX;
|
||||
} else {
|
||||
$PMA_recoding_engine = PMA_CHARSET_NONE;
|
||||
|
||||
require_once './libraries/header.inc.php';
|
||||
echo __('Couldn\'t use the iconv, libiconv, or recode_string functions, although the necessary extensions appear to be loaded. Check your PHP configuration.');
|
||||
require_once './libraries/footer.inc.php';
|
||||
exit;
|
||||
$PMA_recoding_engine = PMA_CHARSET_ICONV;
|
||||
}
|
||||
} elseif (@function_exists('recode_string')) {
|
||||
$PMA_recoding_engine = PMA_CHARSET_RECODE;
|
||||
} else {
|
||||
$PMA_recoding_engine = PMA_CHARSET_NONE;
|
||||
}
|
||||
} else {
|
||||
$PMA_recoding_engine = PMA_CHARSET_NONE;
|
||||
$PMA_recoding_engine = PMA_CHARSET_NONE;
|
||||
}
|
||||
|
||||
/* Load AIX iconv wrapper if needed */
|
||||
@@ -144,8 +79,6 @@ function PMA_convert_string($src_charset, $dest_charset, $what) {
|
||||
return iconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $what);
|
||||
case PMA_CHARSET_ICONV_AIX:
|
||||
return PMA_aix_iconv_wrapper($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $what);
|
||||
case PMA_CHARSET_LIBICONV:
|
||||
return libiconv($src_charset, $dest_charset, $what);
|
||||
default:
|
||||
return $what;
|
||||
}
|
||||
@@ -170,7 +103,6 @@ function PMA_convert_file($src_charset, $dest_charset, $file) {
|
||||
switch ($GLOBALS['PMA_recoding_engine']) {
|
||||
case PMA_CHARSET_RECODE:
|
||||
case PMA_CHARSET_ICONV:
|
||||
case PMA_CHARSET_LIBICONV:
|
||||
$tmpfname = tempnam('', 'PMA_convert_file');
|
||||
$fin = fopen($file, 'r');
|
||||
$fout = fopen($tmpfname, 'w');
|
||||
@@ -183,8 +115,6 @@ function PMA_convert_file($src_charset, $dest_charset, $file) {
|
||||
$dist = iconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $line);
|
||||
} elseif ($GLOBALS['PMA_recoding_engine'] == PMA_CHARSET_ICONV_AIX) {
|
||||
$dist = PMA_aix_iconv_wrapper($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $line);
|
||||
} else {
|
||||
$dist = libiconv($src_charset, $dest_charset . $GLOBALS['cfg']['IconvExtraParams'], $line);
|
||||
}
|
||||
fputs($fout, $dist);
|
||||
} // end while
|
||||
|
@@ -2001,16 +2001,6 @@ $cfg['DefaultConnectionCollation'] = 'utf8_general_ci';
|
||||
*/
|
||||
$cfg['FilterLanguages'] = '';
|
||||
|
||||
/**
|
||||
* Allow character set recoding of MySQL queries, must be also enabled in language
|
||||
* file to make harder using other language files than Unicode.
|
||||
* Default value is false to avoid problems on servers without the iconv
|
||||
* extension
|
||||
*
|
||||
* @global boolean $cfg['AllowAnywhereRecoding']
|
||||
*/
|
||||
$cfg['AllowAnywhereRecoding'] = false;
|
||||
|
||||
/**
|
||||
* You can select here which functions will be used for character set conversion.
|
||||
* Possible values are:
|
||||
@@ -2018,6 +2008,7 @@ $cfg['AllowAnywhereRecoding'] = false;
|
||||
* recode)
|
||||
* iconv - use iconv or libiconv functions
|
||||
* recode - use recode_string function
|
||||
* none - disable encoding conversion
|
||||
*
|
||||
* @global string $cfg['RecodingEngine']
|
||||
*/
|
||||
|
@@ -24,7 +24,7 @@ $cfg_db['Servers'] = array(1 => array(
|
||||
'AllowDeny' => array(
|
||||
'order' => array('', 'deny,allow', 'allow,deny', 'explicit')),
|
||||
'only_db' => 'array'));
|
||||
$cfg_db['RecodingEngine'] = array('auto', 'iconv', 'recode');
|
||||
$cfg_db['RecodingEngine'] = array('auto', 'iconv', 'recode', 'none');
|
||||
$cfg_db['OBGzip'] = array('auto', true, false);
|
||||
$cfg_db['MemoryLimit'] = 'short_string';
|
||||
$cfg_db['ShowTooltipAliasTB'] = array('nested', true, false);
|
||||
|
@@ -226,7 +226,7 @@ function PMA_fatalError($error_message, $message_args = null)
|
||||
if (! isset($GLOBALS['available_languages'])) {
|
||||
$GLOBALS['cfg'] = array(
|
||||
'DefaultLang' => 'en',
|
||||
'AllowAnywhereRecoding' => false);
|
||||
);
|
||||
|
||||
// Loads the language file
|
||||
require_once './libraries/select_lang.lib.php';
|
||||
|
@@ -199,7 +199,7 @@ echo PMA_pluginGetJavascript($export_list);
|
||||
<div class="formelementrow">
|
||||
<?php
|
||||
// charset of file
|
||||
if ($cfg['AllowAnywhereRecoding']) {
|
||||
if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
|
||||
echo ' <label for="select_charset_of_file">'
|
||||
. __('Character set of the file:') . '</label>' . "\n";
|
||||
|
||||
|
@@ -173,7 +173,7 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
|
||||
|
||||
// charset of file
|
||||
echo '<div class="formelementrow">' . "\n";
|
||||
if ($cfg['AllowAnywhereRecoding']) {
|
||||
if ($GLOBALS['PMA_recoding_engine'] != PMA_CHARSET_NONE) {
|
||||
echo '<label for="charset_of_file">' . __('Character set of the file:') . '</label>';
|
||||
reset($cfg['AvailableCharsets']);
|
||||
echo '<select id="charset_of_file" name="charset_of_file" size="1">';
|
||||
|
@@ -187,7 +187,6 @@ function PMA_exportFooter()
|
||||
}
|
||||
|
||||
// restore connection settings
|
||||
// (not set if $cfg['AllowAnywhereRecoding'] is false)
|
||||
$charset_of_file = isset($GLOBALS['charset_of_file']) ? $GLOBALS['charset_of_file'] : '';
|
||||
if (!empty($GLOBALS['asfile']) && isset($mysql_charset_map[$charset_of_file])) {
|
||||
$foot .= $crlf
|
||||
@@ -276,8 +275,7 @@ function PMA_exportHeader()
|
||||
// so that a utility like the mysql client can interpret
|
||||
// the file correctly
|
||||
if (isset($GLOBALS['charset_of_file']) && isset($mysql_charset_map[$GLOBALS['charset_of_file']])) {
|
||||
// $cfg['AllowAnywhereRecoding'] was true so we got a charset from
|
||||
// the export dialog
|
||||
// we got a charset from the export dialog
|
||||
$set_names = $mysql_charset_map[$GLOBALS['charset_of_file']];
|
||||
} else {
|
||||
// by default we use the connection charset
|
||||
|
@@ -29,7 +29,7 @@ $gnu_iconv_to_aix_iconv_codepage_map = array (
|
||||
// "big5" --> "IBM-eucTW" according to http://kadesh.cepba.upc.es/mancpp/classref/ref/ITranscoder_DSC.htm
|
||||
'big5' => 'IBM-eucTW',
|
||||
|
||||
// Other mappings corresponding to the phpMyAdmin dropdown box when using the AllowAnywhereRecoding feature
|
||||
// Other mappings corresponding to the phpMyAdmin dropdown box when using the charset conversion feature
|
||||
'euc-jp' => 'IBM-eucJP',
|
||||
'koi8-r' => 'IBM-eucKR',
|
||||
'ks_c_5601-1987' => 'KSC5601.1987-0',
|
||||
|
@@ -487,7 +487,6 @@ function PMA_sqlQueryFormBookmark()
|
||||
* @uses $GLOBALS['cfg']['BZipDump']
|
||||
* @uses $GLOBALS['cfg']['UploadDir']
|
||||
* @uses $GLOBALS['cfg']['AvailableCharsets']
|
||||
* @uses $GLOBALS['cfg']['AllowAnywhereRecoding']
|
||||
* @uses __('bzipped')
|
||||
* @uses __('Character set of the file:')
|
||||
* @uses __('Compression')
|
||||
|
931
po/be@latin.po
931
po/be@latin.po
File diff suppressed because it is too large
Load Diff
1035
po/en_GB.po
1035
po/en_GB.po
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
911
po/pt_BR.po
911
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
917
po/sr@latin.po
917
po/sr@latin.po
File diff suppressed because it is too large
Load Diff
948
po/uz@latin.po
948
po/uz@latin.po
File diff suppressed because it is too large
Load Diff
922
po/zh_CN.po
922
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
905
po/zh_TW.po
905
po/zh_TW.po
File diff suppressed because it is too large
Load Diff
@@ -74,7 +74,6 @@ $forms['Server_tracking'] = array('Servers' => array(1 => array(
|
||||
$forms['Import_export'] = array(
|
||||
'UploadDir',
|
||||
'SaveDir',
|
||||
'AllowAnywhereRecoding',
|
||||
'RecodingEngine',
|
||||
'IconvExtraParams',
|
||||
'ZipDump',
|
||||
|
@@ -13,7 +13,6 @@ if (!function_exists('__')) {
|
||||
}
|
||||
|
||||
|
||||
$strSetupAllowAnywhereRecoding_name = __('Allow character set conversion');
|
||||
$strSetupAllowArbitraryServer_desc = __('If enabled user can enter any MySQL server in login form for cookie auth');
|
||||
$strSetupAllowArbitraryServerMsg = __('This [a@?page=form&formset=features#tab_Security]option[/a] should be disabled as it allows attackers to bruteforce login to any MySQL server. If you feel this is necessary, use [a@?page=form&formset=features#tab_Security]trusted proxies list[/a]. However, IP-based protection may not be reliable if your IP belongs to an ISP where thousands of users, including you, are connected to.');
|
||||
$strSetupAllowArbitraryServer_name = __('Allow login to any MySQL server');
|
||||
|
Reference in New Issue
Block a user