make die() messages translatable, where possible

This commit is contained in:
Dieter Adriaenssens 2011-08-25 22:38:51 +02:00
parent fd118e02d4
commit 5c751cd1c0
11 changed files with 18 additions and 17 deletions

View File

@ -26,7 +26,7 @@ $type = $what;
// Check export type
if (! isset($export_list[$type])) {
die('Bad type!');
die(__('Bad type!'));
}
/**
@ -103,7 +103,7 @@ if ($export_type == 'server') {
} elseif ($export_type == 'table' && strlen($db) && strlen($table)) {
$err_url = 'tbl_export.php?' . PMA_generate_common_url($db, $table);
} else {
die('Bad parameters!');
die(__('Bad parameters!'));
}
// Get the functions specific to the export type

View File

@ -18,7 +18,7 @@ if (isset($_REQUEST['filename']) && isset($_REQUEST['image'])) {
/* Check whether MIME type is allowed */
if (! isset($allowed[$_REQUEST['type']])) {
die('Invalid export type');
die(__('Invalid export type'));
}
/*

View File

@ -686,7 +686,7 @@ class PMA_Config
{
// Refuse to work while there still might be some world writable dir:
if (is_dir('./config')) {
die('Remove "./config" directory before using phpMyAdmin!');
die(__('Remove "./config" directory before using phpMyAdmin!'));
}
}
@ -710,8 +710,9 @@ class PMA_Config
if (! is_readable($this->getSource())) {
$this->source_mtime = 0;
die(
'Existing configuration file ('
. $this->getSource() . ') is not readable.'
sprintf(__('Existing configuration file (%d) is not readable.'),
$this->getSource()
)
);
}
@ -734,7 +735,7 @@ class PMA_Config
$this->checkWebServerOs();
if ($this->get('PMA_IS_WINDOWS') == 0) {
$this->source_mtime = 0;
die('Wrong permissions on configuration file, should not be world writable!');
die(__('Wrong permissions on configuration file, should not be world writable!'));
}
}
}

View File

@ -32,7 +32,7 @@ if (function_exists('mcrypt_encrypt')) {
srand((double) microtime() * 1000000);
$td = mcrypt_module_open(MCRYPT_BLOWFISH, '', MCRYPT_MODE_CBC, '');
if ($td === false) {
die('Failed to use Blowfish from mcrypt!');
die(__('Failed to use Blowfish from mcrypt!'));
}
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
$GLOBALS['PMA_Config']->setCookie('pma_mcrypt_iv', base64_encode($iv));

View File

@ -144,7 +144,7 @@ if (!defined('PMA_MINIMUM_COMMON')) {
* protect against possible exploits - there is no need to have so much variables
*/
if (count($_REQUEST) > 1000) {
die('possible exploit');
die(__('possible exploit'));
}
/**
@ -153,7 +153,7 @@ if (count($_REQUEST) > 1000) {
*/
foreach ($GLOBALS as $key => $dummy) {
if (is_numeric($key)) {
die('numeric key detected');
die(__('numeric key detected'));
}
}
unset($dummy);

View File

@ -406,7 +406,7 @@ function PMA_arrayWalkRecursive(&$array, $function, $apply_to_keys_also = false)
{
static $recursive_counter = 0;
if (++$recursive_counter > 1000) {
die('possible deep recursion attack');
die(__('possible deep recursion attack'));
}
foreach ($array as $key => $value) {
if (is_array($value)) {

View File

@ -12,7 +12,7 @@ if (! defined('PHPMYADMIN')) {
*
*/
if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) {
die("GLOBALS overwrite attempt");
die(__("GLOBALS overwrite attempt"));
}
/**

View File

@ -12,7 +12,7 @@ if (! defined('PHPMYADMIN')) {
*
*/
if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) {
die("GLOBALS overwrite attempt");
die(__("GLOBALS overwrite attempt"));
}
/**

View File

@ -22,7 +22,7 @@ require './libraries/config/setup.forms.php';
$formset_id = filter_input(INPUT_GET, 'formset');
$mode = filter_input(INPUT_GET, 'mode');
if (! isset($forms[$formset_id])) {
die('Incorrect formset, check $formsets array in setup/frames/form.inc.php');
die(__('Incorrect formset, check $formsets array in setup/frames/form.inc.php'));
}
if (isset($GLOBALS['strConfigFormset_' . $formset_id])) {
@ -33,4 +33,4 @@ foreach ($forms[$formset_id] as $form_name => $form) {
$form_display->registerForm($form_name, $form);
}
process_formset($form_display);
?>
?>

View File

@ -19,7 +19,7 @@ if ($page === '') {
}
if (!file_exists("./setup/frames/$page.inc.php")) {
// it will happen only when enterung URL by hand, we don't care for these cases
die('Wrong GET file attribute value');
die(__('Wrong GET file attribute value'));
}
// Handle done action info

View File

@ -19,7 +19,7 @@ header('Content-type: application/json');
$vids = explode(',', filter_input(INPUT_POST, 'id'));
$values = json_decode(filter_input(INPUT_POST, 'values'));
if (!($values instanceof stdClass)) {
die('Wrong data');
die(__('Wrong data'));
}
$values = (array)$values;
$result = PMA_config_validate($vids, $values, true);