Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin

This commit is contained in:
Crack
2010-07-20 12:30:03 +02:00
78 changed files with 28749 additions and 29283 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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';

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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']
*/

View File

@@ -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);

View File

@@ -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';

View File

@@ -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";

View File

@@ -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">';

View File

@@ -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

View File

@@ -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',

View File

@@ -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')

907
po/af.po

File diff suppressed because it is too large Load Diff

919
po/ar.po

File diff suppressed because it is too large Load Diff

908
po/az.po

File diff suppressed because it is too large Load Diff

917
po/be.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

915
po/bg.po

File diff suppressed because it is too large Load Diff

924
po/bn.po

File diff suppressed because it is too large Load Diff

907
po/bs.po

File diff suppressed because it is too large Load Diff

929
po/ca.po

File diff suppressed because it is too large Load Diff

897
po/cs.po

File diff suppressed because it is too large Load Diff

892
po/cy.po

File diff suppressed because it is too large Load Diff

915
po/da.po

File diff suppressed because it is too large Load Diff

934
po/de.po

File diff suppressed because it is too large Load Diff

949
po/el.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

935
po/es.po

File diff suppressed because it is too large Load Diff

907
po/et.po

File diff suppressed because it is too large Load Diff

909
po/eu.po

File diff suppressed because it is too large Load Diff

906
po/fa.po

File diff suppressed because it is too large Load Diff

924
po/fi.po

File diff suppressed because it is too large Load Diff

944
po/fr.po

File diff suppressed because it is too large Load Diff

928
po/gl.po

File diff suppressed because it is too large Load Diff

902
po/he.po

File diff suppressed because it is too large Load Diff

889
po/hi.po

File diff suppressed because it is too large Load Diff

917
po/hr.po

File diff suppressed because it is too large Load Diff

940
po/hu.po

File diff suppressed because it is too large Load Diff

913
po/id.po

File diff suppressed because it is too large Load Diff

915
po/it.po

File diff suppressed because it is too large Load Diff

909
po/ja.po

File diff suppressed because it is too large Load Diff

1009
po/ka.po

File diff suppressed because it is too large Load Diff

897
po/ko.po

File diff suppressed because it is too large Load Diff

919
po/lt.po

File diff suppressed because it is too large Load Diff

913
po/lv.po

File diff suppressed because it is too large Load Diff

909
po/mk.po

File diff suppressed because it is too large Load Diff

915
po/mn.po

File diff suppressed because it is too large Load Diff

908
po/ms.po

File diff suppressed because it is too large Load Diff

924
po/nb.po

File diff suppressed because it is too large Load Diff

920
po/nl.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

936
po/pl.po

File diff suppressed because it is too large Load Diff

911
po/pt.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

917
po/ro.po

File diff suppressed because it is too large Load Diff

940
po/ru.po

File diff suppressed because it is too large Load Diff

920
po/si.po

File diff suppressed because it is too large Load Diff

917
po/sk.po

File diff suppressed because it is too large Load Diff

921
po/sl.po

File diff suppressed because it is too large Load Diff

909
po/sq.po

File diff suppressed because it is too large Load Diff

917
po/sr.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

926
po/sv.po

File diff suppressed because it is too large Load Diff

879
po/ta.po

File diff suppressed because it is too large Load Diff

882
po/te.po

File diff suppressed because it is too large Load Diff

905
po/th.po

File diff suppressed because it is too large Load Diff

919
po/tr.po

File diff suppressed because it is too large Load Diff

909
po/tt.po

File diff suppressed because it is too large Load Diff

887
po/ug.po

File diff suppressed because it is too large Load Diff

913
po/uk.po

File diff suppressed because it is too large Load Diff

893
po/ur.po

File diff suppressed because it is too large Load Diff

940
po/uz.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -74,7 +74,6 @@ $forms['Server_tracking'] = array('Servers' => array(1 => array(
$forms['Import_export'] = array(
'UploadDir',
'SaveDir',
'AllowAnywhereRecoding',
'RecodingEngine',
'IconvExtraParams',
'ZipDump',

View File

@@ -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&amp;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&amp;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');