bug #1859460, prevent an empty target_db field to produce a failure, thanks to windkiel

This commit is contained in:
Marc Delisle
2007-12-30 20:59:57 +00:00
parent ae7a68de1a
commit b4a620a714
2 changed files with 10 additions and 2 deletions

View File

@@ -26,6 +26,14 @@ $err_url = 'tbl_sql.php?' . PMA_generate_common_url($db, $table);
*/
PMA_DBI_select_db($db);
/**
* $target_db could be empty in case we came from an input field
* (when there are many databases, no drop-down)
*/
if (empty($target_db)) {
$target_db = $db;
}
/**
* A target table name has been sent to this script -> do the work
*/

View File

@@ -190,7 +190,7 @@ unset($columns);
<legend><?php echo $strMoveTable; ?></legend>
<?php if ($GLOBALS['PMA_List_Database']->count() > $GLOBALS['cfg']['MaxDbList']) {
?>
<input type="text" maxlength="100" size="30" name="target_db" />
<input type="text" maxlength="100" size="30" name="target_db" value="<?php echo htmlspecialchars($GLOBALS['db']); ?>"/>
<?php
} else {
?>
@@ -353,7 +353,7 @@ if (isset($auto_increment) && strlen($auto_increment) > 0
<legend><?php echo $strCopyTable; ?></legend>
<?php if ($GLOBALS['PMA_List_Database']->count() > $GLOBALS['cfg']['MaxDbList']) {
?>
<input type="text" maxlength="100" size="30" name="target_db" />
<input type="text" maxlength="100" size="30" name="target_db" value="<?php echo htmlspecialchars($GLOBALS['db']); ?>"/>
<?php
} else {
?>