Skip to content
Permalink
Browse files

Retrieve parameters from $_POST in central columns page

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
  • Loading branch information...
mauriciofauth committed Jul 14, 2018
1 parent 98ef759 commit 77ea7024bfa75659dea20dacb225f0d48414fd02
@@ -84,9 +84,9 @@
$pmatable = $cfgCentralColumns['table'];
$max_rows = intval($GLOBALS['cfg']['MaxRows']);
if (isset($_REQUEST['edit_central_columns_page'])) {
$selected_fld = $_REQUEST['selected_fld'];
$selected_db = $_REQUEST['db'];
if (isset($_POST['edit_central_columns_page'])) {
$selected_fld = $_POST['selected_fld'];
$selected_db = $_POST['db'];
$edit_central_column_page = $centralColumns->getHtmlForEditingPage(
$selected_fld,
$selected_db
@@ -109,15 +109,15 @@
false
);
}
if (!empty($_REQUEST['total_rows'])
&& Core::isValid($_REQUEST['total_rows'], 'integer')
if (!empty($_POST['total_rows'])
&& Core::isValid($_POST['total_rows'], 'integer')
) {
$total_rows = $_REQUEST['total_rows'];
$total_rows = $_POST['total_rows'];
} else {
$total_rows = $centralColumns->getCount($db);
}
if (Core::isValid($_REQUEST['pos'], 'integer')) {
$pos = intval($_REQUEST['pos']);
if (Core::isValid($_POST['pos'], 'integer')) {
$pos = intval($_POST['pos']);
} else {
$pos = 0;
}
@@ -65,10 +65,10 @@ AJAX.registerOnload('db_central_columns.js', function () {
return false;
}
var argsep = PMA_commonParams.get('arg_separator');
var editColumnData = editColumnList + '' + argsep + 'edit_central_columns_page=true' + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'db=' + PMA_commonParams.get('db');
var editColumnData = editColumnList + '' + argsep + 'edit_central_columns_page=true' + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'db=' + encodeURIComponent(PMA_commonParams.get('db'));
PMA_ajaxShowMessage();
AJAX.source = $(this);
$.get('db_central_columns.php', editColumnData, AJAX.responseHandler);
$.post('db_central_columns.php', editColumnData, AJAX.responseHandler);
});
$('#multi_edit_central_columns').submit(function (event) {
event.preventDefault();
@@ -299,7 +299,7 @@ public function syncUniqueColumns(
if (empty($cfgCentralColumns)) {
return $this->configErrorMessage();
}
$db = $_REQUEST['db'];
$db = $_POST['db'];
$pmadb = $cfgCentralColumns['db'];
$central_list_table = $cfgCentralColumns['table'];
$this->dbi->selectDb($db);
@@ -333,7 +333,7 @@ public function syncUniqueColumns(
}
} else {
if ($table === null) {
$table = $_REQUEST['table'];
$table = $_POST['table'];
}
foreach ($field_select as $column) {
$cols .= "'" . $this->dbi->escapeString($column) . "',";
@@ -406,7 +406,7 @@ public function deleteColumnsFromList(
if (empty($cfgCentralColumns)) {
return $this->configErrorMessage();
}
$db = $_REQUEST['db'];
$db = $_POST['db'];
$pmadb = $cfgCentralColumns['db'];
$central_list_table = $cfgCentralColumns['table'];
$this->dbi->selectDb($db);
@@ -227,8 +227,8 @@ function testGetCount()
*/
public function testSyncUniqueColumns()
{
$_REQUEST['db'] = 'PMA_db';
$_REQUEST['table'] = 'PMA_table';
$_POST['db'] = 'PMA_db';
$_POST['table'] = 'PMA_table';
$this->assertTrue(
$this->centralColumns->syncUniqueColumns(
@@ -244,8 +244,8 @@ public function testSyncUniqueColumns()
*/
public function testDeleteColumnsFromList()
{
$_REQUEST['db'] = 'PMA_db';
$_REQUEST['table'] = 'PMA_table';
$_POST['db'] = 'PMA_db';
$_POST['table'] = 'PMA_table';
// when column exists in the central column list
$GLOBALS['dbi']->expects($this->at(4))

0 comments on commit 77ea702

Please sign in to comment.
You can’t perform that action at this time.