From 9344d5ea793ad4ae451db7a5c8d76bcd88f7f0e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Chapeaux?= Date: Fri, 27 Sep 2002 15:15:11 +0000 Subject: [PATCH] fixed bug #614303 (Duplicate args in table tabs links) --- ChangeLog | 3 +++ ldi_check.php3 | 6 ++---- ldi_table.php3 | 2 +- sql.php3 | 1 + tbl_properties.php3 | 2 +- tbl_properties_common.php3 | 3 +-- tbl_properties_export.php3 | 2 +- tbl_properties_links.php3 | 8 +------- tbl_properties_operations.php3 | 3 +-- tbl_properties_options.php3 | 3 +-- tbl_properties_structure.php3 | 2 -- tbl_relation.php3 | 7 +------ tbl_select.php3 | 2 +- 13 files changed, 15 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 39b9b32e2..bda29db2e 100755 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,9 @@ $Source$ * db_details_qbe.php3: PHP3 fixes & coding standards. * db_details_importdocsql.php3: optimization, xhtml fixes & coding standards. + * ldi_check.php3, ldi_table.php3, sql.php3, most of "tbl_properties*" + scripts, tbl_relation.php3, tbl_select.php3: fixed bug #614303 + (Duplicate args in table tabs links) 2002-09-26 Marc Delisle * config.inc.php3, libraries/config_import.lib.php3: let UploadDir diff --git a/ldi_check.php3 b/ldi_check.php3 index 1171ff0b6..da587f473 100755 --- a/ldi_check.php3 +++ b/ldi_check.php3 @@ -102,13 +102,11 @@ if (isset($btnLDI) && ($textfile != 'none')) { $sql_query = $query; } - // Set an empty sub_part to avoid an undefined variable. - // We could also rename the ldi* scripts - // to tbl_properties_ldi* to improve consistency with the other sub-pages. + // We could rename the ldi* scripts to tbl_properties_ldi* to improve + // consistency with the other sub-pages. // // The $goto in ldi_table.php3 is set to tbl_properties.php3 but maybe // if would be better to Browse the latest inserted data. - $sub_part = ''; include('./sql.php3'); } diff --git a/ldi_table.php3 b/ldi_table.php3 index 52e5b9303..8a0d57b28 100755 --- a/ldi_table.php3 +++ b/ldi_table.php3 @@ -12,7 +12,7 @@ */ require('./tbl_properties_common.php3'); $err_url = 'ldi_table.php3' . $err_url; -$url_query .= '&back=ldi_table.php3'; +$url_query .= '&goto=ldi_table.php3&back=ldi_table.php3'; require('./tbl_properties_table_info.php3'); diff --git a/sql.php3 b/sql.php3 index a002c7b43..bf41e6833 100755 --- a/sql.php3 +++ b/sql.php3 @@ -485,6 +485,7 @@ else { unset($message); if (!empty($table)) { include('./tbl_properties_common.php3'); + $url_query .= '&goto=tbl_properties.php3&back=tbl_properties.php3'; include('./tbl_properties_table_info.php3'); } else { diff --git a/tbl_properties.php3 b/tbl_properties.php3 index eaafe3c39..e440c623f 100755 --- a/tbl_properties.php3 +++ b/tbl_properties.php3 @@ -7,7 +7,7 @@ */ require('./tbl_properties_common.php3'); $err_url = 'tbl_properties.php3' . $err_url; -$url_query .= '&back=tbl_properties.php3'; +$url_query .= '&goto=tbl_properties.php3&back=tbl_properties.php3'; /** * Top menu diff --git a/tbl_properties_common.php3 b/tbl_properties_common.php3 index d3c743b7e..c18f3c7e6 100755 --- a/tbl_properties_common.php3 +++ b/tbl_properties_common.php3 @@ -56,7 +56,6 @@ $url_query = 'lang=' . $lang . '&convcharset=' . $convcharset . '&server=' . $server . '&db=' . urlencode($db) - . '&table=' . urlencode($table) - . '&goto=tbl_properties.php3'; + . '&table=' . urlencode($table); ?> diff --git a/tbl_properties_export.php3 b/tbl_properties_export.php3 index 6303440de..578d53937 100755 --- a/tbl_properties_export.php3 +++ b/tbl_properties_export.php3 @@ -6,7 +6,7 @@ * Gets tables informations and displays top links */ require('./tbl_properties_common.php3'); -$sub_part = '_export'; +$url_query .= '&goto=tbl_properties_export.php3&back=tbl_properties_export.php3'; require('./tbl_properties_table_info.php3'); ?> diff --git a/tbl_properties_links.php3 b/tbl_properties_links.php3 index a495c6eea..14e816d59 100755 --- a/tbl_properties_links.php3 +++ b/tbl_properties_links.php3 @@ -43,16 +43,10 @@ if ($table_info_num_rows > 0) { $att6 = ''; } -// The use of $sub_part when setting $arg7 would work if all sub-pages scripts -// were prefixed by "tbl_properties", but this is not the case for now. // The 'back' is supposed to be set to the current sub-page. This is necessary // when you have js deactivated, you click on Drop, then click cancel, and want // to get back to the same sub-page. -if (!isset($sub_part)) { - $sub_part = ''; -} - -$arg7 = ereg_replace('tbl_properties.php3$', 'db_details.php3', $url_query) . '&back=tbl_properties' . $sub_part . '.php3&reload=1&sql_query=' . urlencode('DROP TABLE ' . PMA_backquote($table) ) . '&zero_rows=' . urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($table))); +$arg7 = ereg_replace('tbl_properties[^.]*.php3$', 'db_details.php3', $url_query) . '&reload=1&sql_query=' . urlencode('DROP TABLE ' . PMA_backquote($table) ) . '&zero_rows=' . urlencode(sprintf($strTableHasBeenDropped, htmlspecialchars($table))); $att7 = 'class="drop" onclick="return confirmLink(this, \'DROP TABLE ' . PMA_jsFormat($table) . '\')"'; diff --git a/tbl_properties_operations.php3 b/tbl_properties_operations.php3 index 02dfb113d..7226f3602 100755 --- a/tbl_properties_operations.php3 +++ b/tbl_properties_operations.php3 @@ -7,7 +7,7 @@ */ require('./tbl_properties_common.php3'); $err_url = 'tbl_properties_operations.php3' . $err_url; -$url_query .= '&back=tbl_properties_operations.php3'; +$url_query .= '&goto=tbl_properties_operations.php3&back=tbl_properties_operations.php3'; /** @@ -31,7 +31,6 @@ if (isset($submitorderby) && !empty($order_field)) { /** * Gets tables informations and displays top links */ -$sub_part = '_operations'; require('./tbl_properties_table_info.php3'); diff --git a/tbl_properties_options.php3 b/tbl_properties_options.php3 index e6edbc345..7d236cc99 100755 --- a/tbl_properties_options.php3 +++ b/tbl_properties_options.php3 @@ -7,7 +7,7 @@ */ require('./tbl_properties_common.php3'); $err_url = 'tbl_properties_options.php3' . $err_url; -$url_query .= '&back=tbl_properties_options.php3'; +$url_query .= '&goto=tbl_properties_options.php3&back=tbl_properties_options.php3'; /** @@ -46,7 +46,6 @@ if (isset($message)) { /** * Gets tables informations and displays top links */ -$sub_part = '_options'; require('./tbl_properties_table_info.php3'); diff --git a/tbl_properties_structure.php3 b/tbl_properties_structure.php3 index 58a44b787..de0b5074c 100755 --- a/tbl_properties_structure.php3 +++ b/tbl_properties_structure.php3 @@ -24,7 +24,6 @@ if ((!empty($submit_mult) && isset($selected_fld)) * Prepares the table structure display */ // 1. Get table information -$sub_part = '_structure'; require('./tbl_properties_table_info.php3'); // 2. Gets table keys and retains them @@ -264,7 +263,6 @@ if ($fields_cnt > 20) { 20) echo "\n\n"; diff --git a/tbl_relation.php3 b/tbl_relation.php3 index 85d3805e4..f8dec0fca 100644 --- a/tbl_relation.php3 +++ b/tbl_relation.php3 @@ -4,16 +4,11 @@ /** * Gets some core libraries - * - * I am including part of the tbl_properties stuff which will complain if it is - * not being told what part of the tbl_properties is calling it, so i set this - * variable empty: */ -$sub_part=''; - require('./libraries/grab_globals.lib.php3'); require('./libraries/common.lib.php3'); require('./tbl_properties_common.php3'); +$url_query .= '&goto=tbl_properties.php3'; require('./tbl_properties_table_info.php3'); require('./libraries/relation.lib.php3'); diff --git a/tbl_select.php3 b/tbl_select.php3 index 7127c3dd0..381f84d97 100755 --- a/tbl_select.php3 +++ b/tbl_select.php3 @@ -24,7 +24,7 @@ if (!isset($param) || $param[0] == '') { // Gets some core libraries include('./tbl_properties_common.php3'); $err_url = 'tbl_select.php3' . $err_url; - $url_query .= '&back=tbl_select.php3'; + $url_query .= '&goto=tbl_select.php3&back=tbl_select.php3'; include('./tbl_properties_table_info.php3'); // Defines the url to return to in case of error in the next sql statement