bug #1798646 [display] Character + in query wrongly interpreted
[phpmyadmin/crack.git] / tbl_move_copy.php
blob02f44c4827629b6a9d95de85576a7cca9385b7ef
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @version $Id$
6 */
8 /**
9 * Gets some core libraries
11 require_once './libraries/common.inc.php';
12 require_once './libraries/Table.class.php';
14 // Check parameters
16 PMA_checkParameters(array('db', 'table'));
18 /**
19 * Defines the url to return to in case of error in a sql statement
21 $err_url = 'tbl_sql.php?' . PMA_generate_common_url($db, $table);
24 /**
25 * Selects the database to work with
27 PMA_DBI_select_db($db);
29 /**
30 * A target table name has been sent to this script -> do the work
32 if (isset($new_name) && trim($new_name) != '') {
33 if ($db == $target_db && $table == $new_name) {
34 $message = (isset($submit_move) ? $strMoveTableSameNames : $strCopyTableSameNames);
35 } else {
36 PMA_Table::moveCopy($db, $table, $target_db, $new_name, $what, isset($submit_move), 'one_table');
37 $js_to_run = 'functions.js';
38 $message = (isset($submit_move) ? $strMoveTableOK : $strCopyTableOK);
39 $message = sprintf($message, htmlspecialchars($table), htmlspecialchars($new_name));
40 $reload = 1;
41 /* Check: Work on new table or on old table? */
42 if (isset($submit_move)) {
43 $db = $target_db;
44 $table = $new_name;
45 } else {
46 $pma_uri_parts = parse_url($cfg['PmaAbsoluteUri']);
47 if (isset($switch_to_new) && $switch_to_new == 'true') {
48 PMA_setCookie('pma_switch_to_new', 'true');
49 $db = $target_db;
50 $table = $new_name;
51 } else {
52 PMA_removeCookie('pma_switch_to_new');
56 require_once './libraries/header.inc.php';
57 } // end is target table name
60 /**
61 * No new name for the table!
63 else {
64 require_once './libraries/header.inc.php';
65 PMA_mysqlDie($strTableEmpty, '', '', $err_url);
69 /**
70 * Back to the calling script
73 require './tbl_sql.php';