Choosing not to execute a drop statement leads now to the calling script

This commit is contained in:
Loïc Chapeaux
2001-08-19 13:44:25 +00:00
parent e3844359a7
commit ebafc33367
4 changed files with 21 additions and 5 deletions

View File

@@ -309,7 +309,12 @@ $url_query = 'lang=' . $lang
. '&db=' . urlencode($db) . '&db=' . urlencode($db)
. '&goto=db_details.php3'; . '&goto=db_details.php3';
if (isset($show_query) && $show_query == 'y') { if (isset($show_query) && $show_query == 'y') {
if (get_magic_quotes_gpc()) { // This script has been called by db_readdump.php3
if (isset($sql_query_cpy)) {
$query_to_display = $sql_query_cpy;
}
// Other cases
else if (get_magic_quotes_gpc()) {
$query_to_display = stripslashes($sql_query); $query_to_display = stripslashes($sql_query);
} }
else { else {
@@ -534,7 +539,7 @@ echo ' ' . '&nbsp;<input type="submit" value="' . $strGo . '" />' . "\n";
<!-- Drop table --> <!-- Drop table -->
<li> <li>
<a href="sql.php3?server=<?php echo $server; ?>&lang=<?php echo $lang; ?>&db=<?php echo $db; ?>&sql_query=<?php echo urlencode('DROP DATABASE ' . backquote($db)); ?>&zero_rows=<?php echo urlencode($strDatabase . ' ' . htmlspecialchars(backquote($db)) . ' ' . $strHasBeenDropped); ?>&goto=main.php3&reload=true"> <a href="sql.php3?server=<?php echo $server; ?>&lang=<?php echo $lang; ?>&db=<?php echo $db; ?>&sql_query=<?php echo urlencode('DROP DATABASE ' . backquote($db)); ?>&zero_rows=<?php echo urlencode($strDatabase . ' ' . htmlspecialchars(backquote($db)) . ' ' . $strHasBeenDropped); ?>&goto=main.php3&back=db_details.php3&reload=true">
<?php echo $strDropDB . ' ' . htmlspecialchars($db); ?></a> <?php echo $strDropDB . ' ' . htmlspecialchars($db); ?></a>
<?php echo show_docu('manual_Reference.html#DROP_DATABASE') . "\n"; ?> <?php echo show_docu('manual_Reference.html#DROP_DATABASE') . "\n"; ?>
</li> </li>

View File

@@ -60,7 +60,8 @@ A:hover.nav {font-family: <?php echo $right_font_family; ?>; color: #FF0000}
<?php <?php
if (isset($db)) { if (isset($db)) {
echo '<h1> ' . $strDatabase . ' ' . htmlspecialchars($db); echo '<h1> ' . $strDatabase . ' ' . htmlspecialchars($db);
if (isset($table) && !isset($btnDrop)) { if (!empty($table)
&& (!isset($btnDrop) || $btnDrop == $strNo)) {
echo ' - ' . $strTable . ' ' . htmlspecialchars($table); echo ' - ' . $strTable . ' ' . htmlspecialchars($table);
} }
echo '</h1>' . "\n"; echo '</h1>' . "\n";

View File

@@ -35,9 +35,18 @@ if (isset($btnDrop) || isset($navig)) {
* Go back to further page if table should not be dropped * Go back to further page if table should not be dropped
*/ */
if (isset($goto) && $goto == 'sql.php3') { if (isset($goto) && $goto == 'sql.php3') {
$goto = "sql.php3?server=$server&lang=$lang&db=$db&table=$table&pos=$pos&sql_query=" . urlencode($sql_query); $goto = 'sql.php3'
. '?lang=' . $lang
. '&server=' . urlencode($server)
. '&db=' . urlencode($db)
. '&table=' . urlencode($table)
. '&pos=' . $pos
. '&sql_query=' . urlencode($sql_query);
} }
if (isset($btnDrop) && $btnDrop == $strNo) { if (isset($btnDrop) && $btnDrop == $strNo) {
if (!empty($back)) {
$goto = $back;
}
if (file_exists('./' . $goto)) { if (file_exists('./' . $goto)) {
include('./' . ereg_replace('\.\.*', '.', $goto)); include('./' . ereg_replace('\.\.*', '.', $goto));
} else { } else {
@@ -78,6 +87,7 @@ if ($do_confirm) {
<input type="hidden" name="zero_rows" value="<?php echo isset($zero_rows) ? $zero_rows : ''; ?>" /> <input type="hidden" name="zero_rows" value="<?php echo isset($zero_rows) ? $zero_rows : ''; ?>" />
<input type="hidden" name="table" value="<?php echo isset($table) ? $table : ''; ?>" /> <input type="hidden" name="table" value="<?php echo isset($table) ? $table : ''; ?>" />
<input type="hidden" name="goto" value="<?php echo isset($goto) ? $goto : ''; ?>" /> <input type="hidden" name="goto" value="<?php echo isset($goto) ? $goto : ''; ?>" />
<input type="hidden" name="back" value="<?php echo isset($back) ? $back : ''; ?>" />
<input type="hidden" name="reload" value="<?php echo isset($reload) ? $reload : ''; ?>" /> <input type="hidden" name="reload" value="<?php echo isset($reload) ? $reload : ''; ?>" />
<input type="hidden" name="show_query" value="<?php echo isset($show_query) ? $show_query : ''; ?>" /> <input type="hidden" name="show_query" value="<?php echo isset($show_query) ? $show_query : ''; ?>" />
<input type="submit" name="btnDrop" value="<?php echo $strYes; ?>" /> <input type="submit" name="btnDrop" value="<?php echo $strYes; ?>" />

View File

@@ -973,7 +973,7 @@ else { // MySQL < 3.23
<!-- Deletes the table --> <!-- Deletes the table -->
<li> <li>
<a href="sql.php3?<?php echo ereg_replace('tbl_properties.php3$', 'db_details.php3', $url_query); ?>&reload=true&sql_query=<?php echo urlencode('DROP TABLE ' . backquote($table)); ?>&zero_rows=<?php echo urlencode($strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenDropped); ?>"> <a href="sql.php3?<?php echo ereg_replace('tbl_properties.php3$', 'db_details.php3', $url_query); ?>&back=tbl_properties.php3&reload=true&sql_query=<?php echo urlencode('DROP TABLE ' . backquote($table)); ?>&zero_rows=<?php echo urlencode($strTable . ' ' . htmlspecialchars($table) . ' ' . $strHasBeenDropped); ?>">
<?php echo $strDrop . ' ' . htmlspecialchars($table); ?></a> <?php echo $strDrop . ' ' . htmlspecialchars($table); ?></a>
</li> </li>