Skip to content

Commit

Permalink
Adds error if copy database name have the same name
Browse files Browse the repository at this point in the history
Fixes phpmyadmin#13099
Fixes phpmyadmin#13104

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Apr 12, 2017
1 parent 34795cd commit dbdd7bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ phpMyAdmin - ChangeLog
- issue #13110 Indicate when HTTPS is not properly reported on the server
- issue #13119 No database selected error when adding foreign key
- issue #12388 Improved database search to allow search for exact phrase match
- issue #13099 Report error when trying to copy database to same name

4.7.1 (not yet released)
- issue #13132 Always execute tracking queries as controluser
Expand Down
4 changes: 4 additions & 0 deletions db_operations.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@

if (! isset($_REQUEST['newname']) || strlen($_REQUEST['newname']) === 0) {
$message = PMA\libraries\Message::error(__('The database name is empty!'));
} else if($_REQUEST['newname'] === $_REQUEST['db']) {
$message = PMA\libraries\Message::error(
__('Cannot copy database to the same name. Change the name and try again.')
);
} else {
$_error = false;
if ($move || ! empty($_REQUEST['create_database_before_copying'])) {
Expand Down

0 comments on commit dbdd7bc

Please sign in to comment.