From e56dc294bee13210674d4d3f6a6f9df5bafaee0e Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Wed, 5 Feb 2003 11:02:18 +0000 Subject: [PATCH] better logic for displaying upload query --- ChangeLog | 5 +++++ tbl_replace.php3 | 11 +++++------ tbl_replace_fields.php3 | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 31b8f7aab..1538ad3f7 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,11 @@ phpMyAdmin - Changelog $Id$ $Source$ +2003-02-05 Marc Delisle + * tbl_replace.php3, tbl_replace_fields.php3: do not display the + UPDATE query if there was some binary upload in it, otherwise + display it + 2003-02-04 Alexander M. Turek * common.lib.php3: - Patch #669255 (Initial DB list for MySQL > 4.0.2), thanks to Charles diff --git a/tbl_replace.php3 b/tbl_replace.php3 index 57512e14e..d8b91a931 100755 --- a/tbl_replace.php3 +++ b/tbl_replace.php3 @@ -69,7 +69,7 @@ if (isset($funcs)) { if (get_magic_quotes_gpc()) { $submit_type = stripslashes($submit_type); } - +$seen_binary = FALSE; /** * Prepares the update of a row @@ -187,11 +187,10 @@ if (!$result) { // I don't understand this one: //$add_query = (strpos(' ' . $goto, 'tbl_change') ? '&disp_query=' . urlencode($sql_query) : ''); - // if the sql_query was too long (for example because of an upload) - // we do not append the query to the Location - // why 100? well, tell me a better value... - lem9 - - $add_query = (strlen($sql_query) < 100 ? '&disp_query=' . urlencode($sql_query) : ''); + // if we have seen binary, + // we do not append the query to the Location so it won't be displayed + // on the resulting page + $add_query = (!$seen_binary ? '&disp_query=' . urlencode($sql_query) : ''); header('Location: ' . $cfg['PmaAbsoluteUri'] . $goto . '&disp_message=' . urlencode($message) . $add_query); } exit(); diff --git a/tbl_replace_fields.php3 b/tbl_replace_fields.php3 index 3f7075caf..70aabeb9e 100755 --- a/tbl_replace_fields.php3 +++ b/tbl_replace_fields.php3 @@ -15,6 +15,7 @@ // into MySQL and it also allow not to care about charset // conversion that would otherwise corrupt the data. $val = '0x' . bin2hex($val); + $seen_binary = TRUE; } else { // must always add slashes for an uploaded file: // - do not use PMA_sqlAddslashes()