Skip to content

Commit

Permalink
bug #1859460, prevent an empty target_db field to produce a failure, …
Browse files Browse the repository at this point in the history
…thanks to windkiel
  • Loading branch information
lem9 committed Dec 30, 2007
1 parent 683a3e0 commit 823687a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions tbl_move_copy.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@

$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
*/
Expand Down
4 changes: 2 additions & 2 deletions tbl_operations.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
<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 {
?>
Expand Down Expand Up @@ -370,7 +370,7 @@
<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 {
?>
Expand Down

0 comments on commit 823687a

Please sign in to comment.