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 683a3e0926
commit 823687a437
2 changed files with 10 additions and 2 deletions

View File

@@ -28,6 +28,14 @@ PMA_DBI_select_db($db);
$goto = $cfg['DefaultTabTable']; $goto = $cfg['DefaultTabTable'];
/**
* $_REQUEST['target_db'] could be empty in case we came from an input field
* (when there are many databases, no drop-down)
*/
if (empty($_REQUEST['target_db'])) {
$_REQUEST['target_db'] = $db;
}
/** /**
* A target table name has been sent to this script -> do the work * A target table name has been sent to this script -> do the work
*/ */

View File

@@ -211,7 +211,7 @@ unset($columns);
<legend><?php echo $strMoveTable; ?></legend> <legend><?php echo $strMoveTable; ?></legend>
<?php if ($GLOBALS['PMA_List_Database']->count() > $GLOBALS['cfg']['MaxDbList']) { <?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 <?php
} else { } else {
?> ?>
@@ -370,7 +370,7 @@ if (isset($auto_increment) && strlen($auto_increment) > 0
<legend><?php echo $strCopyTable; ?></legend> <legend><?php echo $strCopyTable; ?></legend>
<?php if ($GLOBALS['PMA_List_Database']->count() > $GLOBALS['cfg']['MaxDbList']) { <?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 <?php
} else { } else {
?> ?>