Added some stripslashes to generate correct exports.

This commit is contained in:
Michal Čihař
2003-08-11 08:39:23 +00:00
parent c354643805
commit c69386f3bc
4 changed files with 12 additions and 6 deletions

View File

@@ -5,6 +5,11 @@ phpMyAdmin - Changelog
$Id$
$Source$
2003-08-11 Michal Cihar <nijel@users.sourceforge.net>
* libraries/export/csv.php3, libraries/export/latex.php3,
libraries/export/xml.php3: Added some stripslashes to generate correct
exports.
2003-08-10 Marc Delisle <lem9@users.sourceforge.net>
* server_status.php3: bug 786331, a 100,00% not internationalized,
and align values for "More status variables"

View File

@@ -121,10 +121,10 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
$schema_insert = '';
for ($i = 0; $i < $fields_cnt; $i++) {
if ($enclosed == '') {
$schema_insert .= mysql_field_name($result, $i);
$schema_insert .= stripslashes(mysql_field_name($result, $i));
} else {
$schema_insert .= $enclosed
. str_replace($enclosed, $escaped . $enclosed, mysql_field_name($result, $i))
. str_replace($enclosed, $escaped . $enclosed, stripslashes(mysql_field_name($result, $i)))
. $enclosed;
}
$schema_insert .= $separator;
@@ -142,6 +142,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
$schema_insert .= $GLOBALS[$what . '_replace_null'];
}
else if ($row[$j] == '0' || $row[$j] != '') {
$row[$j] = stripslashes($row[$j]);
// loic1 : always enclose fields
if ($what == 'excel') {
$row[$j] = ereg_replace("\015(\012)?", "\012", $row[$j]);

View File

@@ -124,7 +124,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
// show column names
if (isset($GLOBALS['latex_showcolumns'])) {
$local_buffer = implode("\000", $columns);
$local_buffer = stripslashes(implode("\000", $columns));
for($k=0;$k<count($tex_escape);$k++) {
$local_buffer = str_replace($tex_escape[$k], '\\' . $tex_escape[$k], $local_buffer);
}
@@ -141,7 +141,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
// print each row
for($i = 0; $i < $columns_cnt; $i++) {
if ( isset($record[$columns[$i]]) && (!function_exists('is_null') || !is_null($record[$columns[$i]]))) {
$column_value = $record[$columns[$i]];
$column_value = stripslashes($record[$columns[$i]]);
// $ % { } & # _ ^
// escaping special characters

View File

@@ -110,7 +110,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
$columns_cnt = mysql_num_fields($result);
for ($i = 0; $i < $columns_cnt; $i++) {
$columns[$i] = mysql_field_name($result, $i);
$columns[$i] = stripslashes(mysql_field_name($result, $i));
}
unset($i);
@@ -122,7 +122,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
for ($i = 0; $i < $columns_cnt; $i++) {
// There is no way to dectect a "NULL" value with PHP3
if ( isset($record[$columns[$i]]) && (!function_exists('is_null') || !is_null($record[$columns[$i]]))) {
$buffer .= ' <' . $columns[$i] . '>' . htmlspecialchars($record[$columns[$i]])
$buffer .= ' <' . $columns[$i] . '>' . htmlspecialchars(stripslashes($record[$columns[$i]]))
. '</' . $columns[$i] . '>' . $crlf;
}
}