Remove _url_query attribute from DatabaseStructureController.php

It was used only in two locations and in both of them the different URL
query was constructed, so it's better to contruct new queries directly.

Fixes #13373

Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
Michal Čihař 2017-06-13 09:39:23 +02:00
parent 6c376de12a
commit fc9140c0c5
2 changed files with 9 additions and 21 deletions

View File

@ -29,7 +29,6 @@ $container->alias('response', 'PMA\libraries\Response');
/* Define dependencies for the concerned controller */
$dependency_definitions = array(
'db' => $db,
'url_query' => &$GLOBALS['url_query'],
);
/** @var DatabaseStructureController $controller */

View File

@ -34,10 +34,6 @@ require_once 'libraries/config/page_settings.forms.php';
*/
class DatabaseStructureController extends DatabaseController
{
/**
* @var string The URL query string
*/
protected $_url_query;
/**
* @var int Number of tables
*/
@ -63,17 +59,6 @@ class DatabaseStructureController extends DatabaseController
*/
protected $_is_show_stats;
/**
* DatabaseStructureController constructor
*
* @param string $url_query URL query
*/
public function __construct($url_query) {
parent::__construct();
$this->_url_query = $url_query;
}
/**
* Retrieves databse information for further use
*
@ -142,8 +127,6 @@ class DatabaseStructureController extends DatabaseController
)
);
$this->_url_query .= '&amp;goto=db_structure.php';
// Gets the database structure
$this->_getDbInfo('_structure');
@ -220,7 +203,12 @@ class DatabaseStructureController extends DatabaseController
/* Printable view of a table */
$this->response->addHTML(
Template::get('database/structure/print_view_data_dictionary_link')
->render(array('url_query' => $this->_url_query))
->render(array('url_query' => URL::getCommon(
array(
'db' => $this->db,
'goto' => 'db_structure.php',
)
)))
);
if (empty($this->_db_is_system_schema)) {
@ -419,8 +407,9 @@ class DatabaseStructureController extends DatabaseController
$table_is_view = false;
// Sets parameters for links
$tbl_url_query = $this->_url_query
. '&amp;table=' . htmlspecialchars($current_table['TABLE_NAME']);
$tbl_url_query = URL::getCommon(
array('db' => $this->db, 'table' => $current_table['TABLE_NAME'])
);
// do not list the previous table's size info for a view
list($current_table, $formatted_size, $unit, $formatted_overhead,