Merge remote-tracking branch 'origin/master'

This commit is contained in:
Pootle server 2011-07-14 02:40:19 +02:00
commit 026999adb7
5 changed files with 19 additions and 18 deletions

View File

@ -1240,8 +1240,8 @@ class PMA_Table
$sql_query =
" SELECT `prefs` FROM " . $pma_table .
" WHERE `username` = '" . $GLOBALS['cfg']['Server']['user'] . "'" .
" AND `db_name` = '" . $this->db_name . "'" .
" AND `table_name` = '" . $this->name . "'";
" AND `db_name` = '" . PMA_sqlAddSlashes($this->db_name) . "'" .
" AND `table_name` = '" . PMA_sqlAddSlashes($this->name) . "'";
$row = PMA_DBI_fetch_array(PMA_query_as_controluser($sql_query));
if (isset($row[0])) {
@ -1264,8 +1264,9 @@ class PMA_Table
$username = $GLOBALS['cfg']['Server']['user'];
$sql_query =
" REPLACE INTO " . $pma_table .
" VALUES ('" . $username . "', '" . $this->db_name . "', '" .
$this->name . "', '" . PMA_sqlAddSlashes(json_encode($this->uiprefs)) . "')";
" VALUES ('" . $username . "', '" . PMA_sqlAddSlashes($this->db_name) . "', '" .
PMA_sqlAddSlashes($this->name) . "', '" .
PMA_sqlAddSlashes(json_encode($this->uiprefs)) . "')";
$success = PMA_DBI_try_query($sql_query, $GLOBALS['controllink']);

View File

@ -268,8 +268,8 @@ class TableProperty
{
$lines=array();
$lines[] = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
$lines[] = "<hibernate-mapping xmlns=\"urn:nhibernate-mapping-2.2\" namespace=\"".ucfirst($db)."\" assembly=\"".ucfirst($db)."\">";
$lines[] = " <class name=\"".ucfirst($table)."\" table=\"".$table."\">";
$lines[] = "<hibernate-mapping xmlns=\"urn:nhibernate-mapping-2.2\" namespace=\"".ucfirst(htmlspecialchars($db, ENT_COMPAT, 'UTF-8'))."\" assembly=\"".ucfirst(htmlspecialchars($db, ENT_COMPAT, 'UTF-8'))."\">";
$lines[] = " <class name=\"".ucfirst(htmlspecialchars($table, ENT_COMPAT, 'UTF-8'))."\" table=\"".htmlspecialchars($table, ENT_COMPAT, 'UTF-8')."\">";
$result = PMA_DBI_query(sprintf("DESC %s.%s", PMA_backquote($db), PMA_backquote($table)));
if ($result)
{

View File

@ -75,7 +75,7 @@ xmlns="http://www.w3.org/TR/REC-html40">
* @access public
*/
function PMA_exportDBHeader($db) {
return PMA_exportOutputHandler('<h1>' . __('Database') . ' ' . $db . '</h1>');
return PMA_exportOutputHandler('<h1>' . __('Database') . ' ' . htmlspecialchars($db) . '</h1>');
}
/**
@ -118,7 +118,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
{
global $what;
if (! PMA_exportOutputHandler('<h2>' . __('Dumping data for table') . ' ' . $table . '</h2>')) {
if (! PMA_exportOutputHandler('<h2>' . __('Dumping data for table') . ' ' . htmlspecialchars($table) . '</h2>')) {
return false;
}
if (! PMA_exportOutputHandler('<table class="width100" cellspacing="1">')) {
@ -192,7 +192,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
{
global $cfgRelation;
if (! PMA_exportOutputHandler('<h2>' . __('Table structure for table') . ' ' .$table . '</h2>')) {
if (! PMA_exportOutputHandler('<h2>' . __('Table structure for table') . ' ' . htmlspecialchars($table) . '</h2>')) {
return false;
}
@ -313,8 +313,6 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
if ($row['Null'] != 'NO') {
$row['Default'] = 'NULL';
}
} else {
$row['Default'] = $row['Default'];
}
$fmt_pre = '';

View File

@ -74,7 +74,7 @@ function PMA_exportHeader()
*/
function PMA_exportDBHeader($db)
{
PMA_exportOutputHandler('/* Database \'' . $db . '\' */ ' . $GLOBALS['crlf'] );
PMA_exportOutputHandler('// Database \'' . $db . '\'' . $GLOBALS['crlf'] );
return true;
}
@ -134,7 +134,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
// Output table name as comment if this is the first record of the table
if ($record_cnt == 1) {
$buffer .= '/* ' . $db . '.' . $table . ' */' . $crlf . $crlf;
$buffer .= '// ' . $db . '.' . $table . $crlf . $crlf;
$buffer .= '[{';
} else {
$buffer .= ', {';
@ -147,18 +147,20 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
$column = $columns[$i];
if (is_null($record[$i])) {
$buffer .= '"' . $column . '": null' . (! $isLastLine ? ',' : '');
$buffer .= '"' . addslashes($column) . '": null' . (! $isLastLine ? ',' : '');
} elseif (is_numeric($record[$i])) {
$buffer .= '"' . $column . '": ' . $record[$i] . (! $isLastLine ? ',' : '');
$buffer .= '"' . addslashes($column) . '": ' . $record[$i] . (! $isLastLine ? ',' : '');
} else {
$buffer .= '"' . $column . '": "' . addslashes($record[$i]) . '"' . (! $isLastLine ? ',' : '');
$buffer .= '"' . addslashes($column) . '": "' . addslashes($record[$i]) . '"' . (! $isLastLine ? ',' : '');
}
}
$buffer .= '}';
}
$buffer .= ']';
if ($record_cnt) {
$buffer .= ']';
}
if (! PMA_exportOutputHandler($buffer)) {
return false;
}

View File

@ -105,7 +105,7 @@ function PMA_exportHeader() {
$head .= '<pma_xml_export version="1.0"' . (($export_struct) ? ' xmlns:pma="http://www.phpmyadmin.net/some_doc_url/"' : '') . '>' . $crlf;
if ($export_struct) {
$result = PMA_DBI_fetch_result('SELECT `DEFAULT_CHARACTER_SET_NAME`, `DEFAULT_COLLATION_NAME` FROM `information_schema`.`SCHEMATA` WHERE `SCHEMA_NAME` = \''.$db.'\' LIMIT 1');
$result = PMA_DBI_fetch_result('SELECT `DEFAULT_CHARACTER_SET_NAME`, `DEFAULT_COLLATION_NAME` FROM `information_schema`.`SCHEMATA` WHERE `SCHEMA_NAME` = \''.PMA_sqlAddSlashes($db).'\' LIMIT 1');
$db_collation = $result[0]['DEFAULT_COLLATION_NAME'];
$db_charset = $result[0]['DEFAULT_CHARACTER_SET_NAME'];