* fixed a bug with headers that may be sent after output

* fixed bug #481417 - Unable to insert dumps from phpmyadmin
This commit is contained in:
Loïc Chapeaux
2001-11-16 14:08:17 +00:00
parent 81f94f9851
commit 7663bd8237
2 changed files with 28 additions and 19 deletions

View File

@@ -11,6 +11,10 @@ $Source$
libraries/common.lib.php3, lines 928-929: fixed bug #479208 - Drop a libraries/common.lib.php3, lines 928-929: fixed bug #479208 - Drop a
Table -> wrong server at left frame thanks to Bjoern Koester Table -> wrong server at left frame thanks to Bjoern Koester
& Donald Saltarelli. & Donald Saltarelli.
* db_details.php3; read_dump.php3; sql.php3; tbl_properties.php3: fixed a
bug with headers that may be sent after output.
* tbl_properties.php3: fixed bug #481417 - Unable to insert dumps from
phpmyadmin.
2001-11-15 Lo<4C>c Chapeaux <lolo@phpheaven.net> 2001-11-15 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* libraries/tbl_dump.php3 : merged a workaround against the IE downloading * libraries/tbl_dump.php3 : merged a workaround against the IE downloading

View File

@@ -28,24 +28,29 @@ $err_url = 'tbl_properties.php3'
* Ensures the database and the table exist (else move to the "parent" script) * Ensures the database and the table exist (else move to the "parent" script)
* and diplays headers * and diplays headers
*/ */
// Not a valid db name -> back to the welcome page if (!isset($is_db) || !$is_db) {
if (!empty($db)) { // Not a valid db name -> back to the welcome page
$is_db = @mysql_select_db($db); if (!empty($db)) {
} $is_db = @mysql_select_db($db);
if (empty($db) || !$is_db) { }
header('Location: ' . $cfgPmaAbsoluteUri . 'main.php3?lang=' . $lang . '&server=' . $server . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); if (empty($db) || !$is_db) {
exit(); header('Location: ' . $cfgPmaAbsoluteUri . 'main.php3?lang=' . $lang . '&server=' . $server . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
} exit();
// Not a valid table name -> back to the db_details.php3 }
if (!empty($table)) { } // end if (ensures db exists)
$is_table = @mysql_query('SHOW TABLES LIKE \'' . sql_addslashes($table, TRUE) . '\''); if (!isset($is_table) || !$is_table) {
} // Not a valid table name -> back to the db_details.php3
if (empty($table) || !@mysql_numrows($is_table)) { if (!empty($table)) {
header('Location: ' . $cfgPmaAbsoluteUri . 'db_details.php3?lang=' . $lang . '&server=' . $server . '&db=' . urlencode($db) . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1'); $is_table = @mysql_query('SHOW TABLES LIKE \'' . sql_addslashes($table, TRUE) . '\'');
exit(); }
} else if (isset($is_table)) { if (empty($table) || !@mysql_numrows($is_table)) {
mysql_free_result($is_table); header('Location: ' . $cfgPmaAbsoluteUri . 'db_details.php3?lang=' . $lang . '&server=' . $server . '&db=' . urlencode($db) . (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1');
} exit();
} else if (isset($is_table)) {
mysql_free_result($is_table);
}
} // end if (ensures table exists)
// Displays headers // Displays headers
if (!isset($message)) { if (!isset($message)) {
$js_to_run = 'functions.js'; $js_to_run = 'functions.js';
@@ -643,7 +648,7 @@ echo "\n";
<!-- Query box and bookmark support --> <!-- Query box and bookmark support -->
<li> <li>
<form method="post" action="read_dump.php3" <form method="post" action="read_dump.php3" enctype="multipart/form-data"
onsubmit="return checkSqlQuery(this)"> onsubmit="return checkSqlQuery(this)">
<input type="hidden" name="is_js_confirmed" value="0" /> <input type="hidden" name="is_js_confirmed" value="0" />
<input type="hidden" name="lang" value="<?php echo $lang; ?>" /> <input type="hidden" name="lang" value="<?php echo $lang; ?>" />