From 7663bd82372074cb2071805b10a05e893ae8bca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Fri, 16 Nov 2001 14:08:17 +0000 Subject: [PATCH] * fixed a bug with headers that may be sent after output * fixed bug #481417 - Unable to insert dumps from phpmyadmin --- ChangeLog | 4 ++++ tbl_properties.php3 | 43 ++++++++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 144214dc7..e0a339c52 100755 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,10 @@ $Source$ libraries/common.lib.php3, lines 928-929: fixed bug #479208 - Drop a Table -> wrong server at left frame thanks to Bjoern Koester & 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ïc Chapeaux * libraries/tbl_dump.php3 : merged a workaround against the IE downloading diff --git a/tbl_properties.php3 b/tbl_properties.php3 index b3cd1c001..1ae9e4204 100755 --- a/tbl_properties.php3 +++ b/tbl_properties.php3 @@ -28,24 +28,29 @@ $err_url = 'tbl_properties.php3' * Ensures the database and the table exist (else move to the "parent" script) * and diplays headers */ -// Not a valid db name -> back to the welcome page -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'); - exit(); -} -// Not a valid table name -> back to the db_details.php3 -if (!empty($table)) { - $is_table = @mysql_query('SHOW TABLES LIKE \'' . sql_addslashes($table, TRUE) . '\''); -} -if (empty($table) || !@mysql_numrows($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); -} +if (!isset($is_db) || !$is_db) { + // Not a valid db name -> back to the welcome page + 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'); + exit(); + } +} // end if (ensures db exists) +if (!isset($is_table) || !$is_table) { + // Not a valid table name -> back to the db_details.php3 + if (!empty($table)) { + $is_table = @mysql_query('SHOW TABLES LIKE \'' . sql_addslashes($table, TRUE) . '\''); + } + if (empty($table) || !@mysql_numrows($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 if (!isset($message)) { $js_to_run = 'functions.js'; @@ -643,7 +648,7 @@ echo "\n";
  • -