Use the router for the database export page
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
parent
61a4c73c6f
commit
ef81c86830
@ -294,7 +294,7 @@ $tables = [];
|
||||
if ($export_type == 'server') {
|
||||
$err_url = 'server_export.php' . Url::getCommon();
|
||||
} elseif ($export_type == 'database' && strlen($db) > 0) {
|
||||
$err_url = 'db_export.php' . Url::getCommon(['db' => $db]);
|
||||
$err_url = Url::getFromRoute('/database/export', ['db' => $db]);
|
||||
// Check if we have something to export
|
||||
if (isset($table_select)) {
|
||||
$tables = $table_select;
|
||||
@ -415,8 +415,8 @@ if ($save_on_server) {
|
||||
$message = PhpMyAdmin\Message::error(
|
||||
__('No tables found in database.')
|
||||
);
|
||||
$active_page = 'db_export.php';
|
||||
include ROOT_PATH . 'db_export.php';
|
||||
$active_page = Url::getFromRoute('/database/export');
|
||||
include ROOT_PATH . 'libraries/entry_points/database/export.php';
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,6 +47,9 @@ if (isset($_GET['route']) || isset($_POST['route'])) {
|
||||
$routes->addRoute(['GET', 'POST'], '/events', function () {
|
||||
require_once ROOT_PATH . 'libraries/entry_points/database/events.php';
|
||||
});
|
||||
$routes->addRoute(['GET', 'POST'], '/export', function () {
|
||||
require_once ROOT_PATH . 'libraries/entry_points/database/export.php';
|
||||
});
|
||||
$routes->addRoute(['GET', 'POST'], '/multi_table_query', function () {
|
||||
require_once ROOT_PATH . 'libraries/entry_points/database/multi_table_query.php';
|
||||
});
|
||||
|
||||
@ -26,7 +26,6 @@ class Core
|
||||
* @static array $goto_whitelist
|
||||
*/
|
||||
public static $goto_whitelist = [
|
||||
'db_export.php',
|
||||
'db_importdocsql.php',
|
||||
'db_import.php',
|
||||
'export.php',
|
||||
|
||||
@ -501,7 +501,7 @@ class Export
|
||||
if ($export_type == 'server') {
|
||||
$back_button .= 'server_export.php" data-post="' . Url::getCommon([], '');
|
||||
} elseif ($export_type == 'database') {
|
||||
$back_button .= 'db_export.php" data-post="' . Url::getCommon(['db' => $db], '');
|
||||
$back_button .= Url::getFromRoute('/database/export') . '" data-post="' . Url::getCommon(['db' => $db], '');
|
||||
} else {
|
||||
$back_button .= 'tbl_export.php" data-post="' . Url::getCommon(
|
||||
[
|
||||
@ -1054,8 +1054,8 @@ class Export
|
||||
$active_page = 'server_export.php';
|
||||
include_once ROOT_PATH . 'server_export.php';
|
||||
} elseif ($export_type == 'database') {
|
||||
$active_page = 'db_export.php';
|
||||
include_once ROOT_PATH . 'db_export.php';
|
||||
$active_page = Url::getFromRoute('/database/export');
|
||||
include_once ROOT_PATH . 'libraries/entry_points/database/export.php';
|
||||
} else {
|
||||
$active_page = 'tbl_export.php';
|
||||
include_once ROOT_PATH . 'tbl_export.php';
|
||||
|
||||
@ -488,7 +488,8 @@ class Menu
|
||||
|
||||
$tabs['export']['text'] = __('Export');
|
||||
$tabs['export']['icon'] = 'b_export';
|
||||
$tabs['export']['link'] = 'db_export.php';
|
||||
$tabs['export']['link'] = Url::getFromRoute('/database/export');
|
||||
$tabs['export']['active'] = isset($_REQUEST['route']) && $_REQUEST['route'] === '/database/export';
|
||||
if ($num_tables == 0) {
|
||||
$tabs['export']['warning'] = __('Database seems to be empty!');
|
||||
}
|
||||
|
||||
@ -13,15 +13,14 @@ use PhpMyAdmin\Display\Export as DisplayExport;
|
||||
use PhpMyAdmin\Export;
|
||||
use PhpMyAdmin\Message;
|
||||
use PhpMyAdmin\Response;
|
||||
use PhpMyAdmin\Url;
|
||||
use PhpMyAdmin\Util;
|
||||
|
||||
if (! defined('ROOT_PATH')) {
|
||||
define('ROOT_PATH', __DIR__ . DIRECTORY_SEPARATOR);
|
||||
if (! defined('PHPMYADMIN')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
global $containerBuilder, $db, $table, $url_query;
|
||||
|
||||
require_once ROOT_PATH . 'libraries/common.inc.php';
|
||||
global $containerBuilder, $db, $table, $url_query, $url_params;
|
||||
|
||||
/** @var Response $response */
|
||||
$response = $containerBuilder->get(Response::class);
|
||||
@ -39,10 +38,15 @@ $scripts->addFile('export.js');
|
||||
$export = $containerBuilder->get('export');
|
||||
|
||||
// $sub_part is used in Util::getDbInfo() to see if we are coming from
|
||||
// db_export.php, in which case we don't obey $cfg['MaxTableList']
|
||||
// /database/export, in which case we don't obey $cfg['MaxTableList']
|
||||
$sub_part = '_export';
|
||||
|
||||
require_once ROOT_PATH . 'libraries/db_common.inc.php';
|
||||
$url_query .= '&goto=db_export.php';
|
||||
|
||||
$url_params = [
|
||||
'goto' => Url::getFromRoute('/database/export'),
|
||||
];
|
||||
$url_query .= Url::getCommon($url_params, '&');
|
||||
|
||||
list(
|
||||
$tables,
|
||||
@ -94,7 +94,7 @@ if (! empty($submit_mult)
|
||||
break;
|
||||
case 'export':
|
||||
unset($submit_mult);
|
||||
include ROOT_PATH . 'db_export.php';
|
||||
include ROOT_PATH . 'libraries/entry_points/database/export.php';
|
||||
exit;
|
||||
case 'copy_tbl':
|
||||
$views = $GLOBALS['dbi']->getVirtualTables($db);
|
||||
|
||||
@ -23,7 +23,6 @@ use stdClass;
|
||||
class CoreTest extends PmaTestCase
|
||||
{
|
||||
protected $goto_whitelist = [
|
||||
'db_export.php',
|
||||
'export.php',
|
||||
'import.php',
|
||||
'index.php',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user