diff --git a/ChangeLog b/ChangeLog index cb3433450d..25757e2b4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,7 +25,9 @@ phpMyAdmin - ChangeLog - issue #14633 Use Sass instead of PHP to compile CSS - issue #14053 Fix missed padding on query results -4.8.4 (not yet released) +4.8.5 (not yet released) + +4.8.4 (2018-12-11) - issue #14452 Remove hash param in edit query URL - issue #14295 Issue in Changing theme - issue #13267 Ensure that database names with '.' are handled properly when DisableIS is true @@ -44,6 +46,9 @@ phpMyAdmin - ChangeLog - issue #13032 Fix designer errors when database contains special chars - issue #14352 Fix designer javascript errors - issue #14764 Fix left/right icons hidden +- issue [security] Local file inclusion flaw in the Transformation feature (PMASA-2018-6) +- issue [security] Multiple CSRF/XSRF vulnerabilities (PMASA-2018-7) +- issue [security] XSS vulnerability in the navigation tree (PMASA-2018-8) 4.8.3 (2018-08-22) - issue #14314 Error when naming a database '0' diff --git a/ajax.php b/ajax.php index f0c8f74877..2816d72734 100644 --- a/ajax.php +++ b/ajax.php @@ -28,19 +28,19 @@ switch ($_POST['type']) { break; case 'list-tables': Util::checkParameters(['db'], true); - $response->addJSON('tables', $GLOBALS['dbi']->getTables($_REQUEST['db'])); + $response->addJSON('tables', $GLOBALS['dbi']->getTables($_POST['db'])); break; case 'list-columns': Util::checkParameters(['db', 'table'], true); - $response->addJSON('columns', $GLOBALS['dbi']->getColumnNames($_REQUEST['db'], $_REQUEST['table'])); + $response->addJSON('columns', $GLOBALS['dbi']->getColumnNames($_POST['db'], $_POST['table'])); break; case 'config-get': Util::checkParameters(['key'], true); - $response->addJSON('value', $GLOBALS['PMA_Config']->get($_REQUEST['key'])); + $response->addJSON('value', $GLOBALS['PMA_Config']->get($_POST['key'])); break; case 'config-set': Util::checkParameters(['key', 'value'], true); - $result = $GLOBALS['PMA_Config']->setUserValue(null, $_REQUEST['key'], json_decode($_REQUEST['value'])); + $result = $GLOBALS['PMA_Config']->setUserValue(null, $_POST['key'], json_decode($_POST['value'])); if ($result !== true) { $response = Response::getInstance(); $response->setRequestStatus(false); diff --git a/browse_foreigners.php b/browse_foreigners.php index 6da290d503..2a4376de42 100644 --- a/browse_foreigners.php +++ b/browse_foreigners.php @@ -15,7 +15,7 @@ use PhpMyAdmin\Util; require_once 'libraries/common.inc.php'; /** - * Sets globals from $_REQUEST + * Sets globals from $_POST */ $request_params = [ 'data', @@ -23,8 +23,8 @@ $request_params = [ ]; foreach ($request_params as $one_request_param) { - if (isset($_REQUEST[$one_request_param])) { - $GLOBALS[$one_request_param] = $_REQUEST[$one_request_param]; + if (isset($_POST[$one_request_param])) { + $GLOBALS[$one_request_param] = $_POST[$one_request_param]; } } @@ -50,15 +50,15 @@ $browseForeigners = new BrowseForeigners( $GLOBALS['pmaThemeImage'] ); $foreign_limit = $browseForeigners->getForeignLimit( - isset($_REQUEST['foreign_showAll']) ? $_REQUEST['foreign_showAll'] : null + isset($_POST['foreign_showAll']) ? $_POST['foreign_showAll'] : null ); $foreignData = $relation->getForeignData( $foreigners, - $_REQUEST['field'], + $_POST['field'], true, - isset($_REQUEST['foreign_filter']) - ? $_REQUEST['foreign_filter'] + isset($_POST['foreign_filter']) + ? $_POST['foreign_filter'] : '', isset($foreign_limit) ? $foreign_limit : null, true // for getting value in $foreignData['the_total'] @@ -68,7 +68,7 @@ $foreignData = $relation->getForeignData( $html = $browseForeigners->getHtmlForRelationalFieldSelection( $db, $table, - $_REQUEST['field'], + $_POST['field'], $foreignData, isset($fieldkey) ? $fieldkey : '', isset($data) ? $data : '' diff --git a/chk_rel.php b/chk_rel.php index cd625fff32..80002acdb7 100644 --- a/chk_rel.php +++ b/chk_rel.php @@ -15,20 +15,20 @@ require_once 'libraries/common.inc.php'; $relation = new Relation($GLOBALS['dbi']); // If request for creating the pmadb -if (isset($_REQUEST['create_pmadb'])) { +if (isset($_POST['create_pmadb'])) { if ($relation->createPmaDatabase()) { $relation->fixPmaTables('phpmyadmin'); } } // If request for creating all PMA tables. -if (isset($_REQUEST['fixall_pmadb'])) { +if (isset($_POST['fixall_pmadb'])) { $relation->fixPmaTables($GLOBALS['db']); } $cfgRelation = $relation->getRelationsParam(); // If request for creating missing PMA tables. -if (isset($_REQUEST['fix_pmadb'])) { +if (isset($_POST['fix_pmadb'])) { $relation->fixPmaTables($cfgRelation['db']); } diff --git a/db_central_columns.php b/db_central_columns.php index 84c71e3d54..5f2dc7cdaf 100644 --- a/db_central_columns.php +++ b/db_central_columns.php @@ -101,9 +101,9 @@ $pmadb = $cfgCentralColumns['db']; $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 @@ -126,15 +126,15 @@ if (isset($_POST['delete_save'])) { 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; } diff --git a/db_designer.php b/db_designer.php index 202de74712..bc9efa69f0 100644 --- a/db_designer.php +++ b/db_designer.php @@ -19,18 +19,18 @@ $databaseDesigner = new Designer($GLOBALS['dbi']); $designerCommon = new Common($GLOBALS['dbi']); if (isset($_REQUEST['dialog'])) { - if ($_REQUEST['dialog'] == 'edit') { + if ($_GET['dialog'] == 'edit') { $html = $databaseDesigner->getHtmlForEditOrDeletePages($GLOBALS['db'], 'editPage'); - } elseif ($_REQUEST['dialog'] == 'delete') { + } elseif ($_GET['dialog'] == 'delete') { $html = $databaseDesigner->getHtmlForEditOrDeletePages($GLOBALS['db'], 'deletePage'); - } elseif ($_REQUEST['dialog'] == 'save_as') { + } elseif ($_GET['dialog'] == 'save_as') { $html = $databaseDesigner->getHtmlForPageSaveAs($GLOBALS['db']); - } elseif ($_REQUEST['dialog'] == 'export') { + } elseif ($_GET['dialog'] == 'export') { $html = $databaseDesigner->getHtmlForSchemaExport( $GLOBALS['db'], - $_REQUEST['selected_page'] + $_GET['selected_page'] ); - } elseif ($_REQUEST['dialog'] == 'add_table') { + } elseif ($_POST['dialog'] == 'add_table') { $script_display_field = $designerCommon->getTablesInfo(); $required = $GLOBALS['db'] . '.' . $GLOBALS['table']; $tab_column = $designerCommon->getColumnsInfo(); @@ -61,51 +61,51 @@ if (isset($_REQUEST['dialog'])) { return; } -if (isset($_REQUEST['operation'])) { - if ($_REQUEST['operation'] == 'deletePage') { - $success = $designerCommon->deletePage($_REQUEST['selected_page']); +if (isset($_POST['operation'])) { + if ($_POST['operation'] == 'deletePage') { + $success = $designerCommon->deletePage($_POST['selected_page']); $response->setRequestStatus($success); - } elseif ($_REQUEST['operation'] == 'savePage') { - if ($_REQUEST['save_page'] == 'same') { - $page = $_REQUEST['selected_page']; + } elseif ($_POST['operation'] == 'savePage') { + if ($_POST['save_page'] == 'same') { + $page = $_POST['selected_page']; } else { // new - $page = $designerCommon->createNewPage($_REQUEST['selected_value'], $GLOBALS['db']); + $page = $designerCommon->createNewPage($_POST['selected_value'], $GLOBALS['db']); $response->addJSON('id', $page); } $success = $designerCommon->saveTablePositions($page); $response->setRequestStatus($success); - } elseif ($_REQUEST['operation'] == 'setDisplayField') { + } elseif ($_POST['operation'] == 'setDisplayField') { $designerCommon->saveDisplayField( - $_REQUEST['db'], - $_REQUEST['table'], - $_REQUEST['field'] + $_POST['db'], + $_POST['table'], + $_POST['field'] ); $response->setRequestStatus(true); - } elseif ($_REQUEST['operation'] == 'addNewRelation') { + } elseif ($_POST['operation'] == 'addNewRelation') { list($success, $message) = $designerCommon->addNewRelation( - $_REQUEST['db'], - $_REQUEST['T1'], - $_REQUEST['F1'], - $_REQUEST['T2'], - $_REQUEST['F2'], - $_REQUEST['on_delete'], - $_REQUEST['on_update'], - $_REQUEST['DB1'], - $_REQUEST['DB2'] + $_POST['db'], + $_POST['T1'], + $_POST['F1'], + $_POST['T2'], + $_POST['F2'], + $_POST['on_delete'], + $_POST['on_update'], + $_POST['DB1'], + $_POST['DB2'] ); $response->setRequestStatus($success); $response->addJSON('message', $message); - } elseif ($_REQUEST['operation'] == 'removeRelation') { + } elseif ($_POST['operation'] == 'removeRelation') { list($success, $message) = $designerCommon->removeRelation( - $_REQUEST['T1'], - $_REQUEST['F1'], - $_REQUEST['T2'], - $_REQUEST['F2'] + $_POST['T1'], + $_POST['F1'], + $_POST['T2'], + $_POST['F2'] ); $response->setRequestStatus($success); $response->addJSON('message', $message); - } elseif ($_REQUEST['operation'] == 'save_setting_value') { - $success = $designerCommon->saveSetting($_REQUEST['index'], $_REQUEST['value']); + } elseif ($_POST['operation'] == 'save_setting_value') { + $success = $designerCommon->saveSetting($_POST['index'], $_POST['value']); $response->setRequestStatus($success); } @@ -124,13 +124,13 @@ $classes_side_menu = $databaseDesigner->returnClassNamesFromMenuButtons(); $display_page = -1; $selected_page = null; -if (isset($_REQUEST['query'])) { - $display_page = $designerCommon->getDefaultPage($_REQUEST['db']); +if (isset($_GET['query'])) { + $display_page = $designerCommon->getDefaultPage($_GET['db']); } else { - if (! empty($_REQUEST['page'])) { - $display_page = $_REQUEST['page']; + if (! empty($_GET['page'])) { + $display_page = $_GET['page']; } else { - $display_page = $designerCommon->getLoadingPage($_REQUEST['db']); + $display_page = $designerCommon->getLoadingPage($_GET['db']); } } if ($display_page != -1) { @@ -180,7 +180,7 @@ $response->addHTML( $script_contr, $script_display_field, $display_page, - isset($_REQUEST['query']), + isset($_GET['query']), $selected_page, $classes_side_menu, $tab_pos, diff --git a/db_export.php b/db_export.php index 234a7d0ccb..756b46f540 100644 --- a/db_export.php +++ b/db_export.php @@ -60,8 +60,8 @@ if ($num_tables < 1) { } // end if $multi_values = '
';
@@ -228,8 +228,8 @@ class ServerBinlogController extends Controller
if ($num_rows >= $GLOBALS['cfg']['MaxRows']) {
$this_url_params = $url_params;
$this_url_params['pos'] = $pos + $GLOBALS['cfg']['MaxRows'];
- $html .= ' - ';
diff --git a/libraries/classes/Controllers/Server/ServerDatabasesController.php b/libraries/classes/Controllers/Server/ServerDatabasesController.php
index 62aa2d9717..4321cec0d6 100644
--- a/libraries/classes/Controllers/Server/ServerDatabasesController.php
+++ b/libraries/classes/Controllers/Server/ServerDatabasesController.php
@@ -61,7 +61,7 @@ class ServerDatabasesController extends Controller
$response = Response::getInstance();
- if (isset($_REQUEST['drop_selected_dbs'])
+ if (isset($_POST['drop_selected_dbs'])
&& $response->isAjax()
&& ($this->dbi->isSuperuser() || $GLOBALS['cfg']['AllowUserDropDatabase'])
) {
@@ -214,7 +214,7 @@ class ServerDatabasesController extends Controller
*/
public function dropDatabasesAction()
{
- if (! isset($_REQUEST['selected_dbs'])) {
+ if (! isset($_POST['selected_dbs'])) {
$message = Message::error(__('No databases selected.'));
} else {
$action = 'server_databases.php';
diff --git a/libraries/classes/Controllers/Server/ServerVariablesController.php b/libraries/classes/Controllers/Server/ServerVariablesController.php
index b09977ff40..6d6b4cb815 100644
--- a/libraries/classes/Controllers/Server/ServerVariablesController.php
+++ b/libraries/classes/Controllers/Server/ServerVariablesController.php
@@ -48,16 +48,16 @@ class ServerVariablesController extends Controller
{
$response = Response::getInstance();
if ($response->isAjax()
- && isset($_REQUEST['type'])
- && $_REQUEST['type'] === 'getval'
+ && isset($_GET['type'])
+ && $_GET['type'] === 'getval'
) {
$this->getValueAction();
return;
}
if ($response->isAjax()
- && isset($_REQUEST['type'])
- && $_REQUEST['type'] === 'setval'
+ && isset($_POST['type'])
+ && $_POST['type'] === 'setval'
) {
$this->setValueAction();
return;
@@ -138,12 +138,12 @@ class ServerVariablesController extends Controller
// when server is running in ANSI_QUOTES sql_mode
$varValue = $this->dbi->fetchSingleRow(
'SHOW GLOBAL VARIABLES WHERE Variable_name=\''
- . $this->dbi->escapeString($_REQUEST['varName']) . '\';',
+ . $this->dbi->escapeString($_GET['varName']) . '\';',
'NUM'
);
try {
- $type = KBSearch::getVariableType($_REQUEST['varName']);
+ $type = KBSearch::getVariableType($_GET['varName']);
if ($type === 'byte') {
$this->response->addJSON(
'message',
@@ -170,10 +170,10 @@ class ServerVariablesController extends Controller
*/
public function setValueAction()
{
- $value = $_REQUEST['varValue'];
+ $value = $_POST['varValue'];
$matches = [];
try {
- $type = KBSearch::getVariableType($_REQUEST['varName']);
+ $type = KBSearch::getVariableType($_POST['varName']);
if ($type === 'byte' && preg_match(
'/^\s*(\d+(\.\d+)?)\s*(mb|kb|mib|kib|gb|gib)\s*$/i',
$value,
@@ -202,20 +202,20 @@ class ServerVariablesController extends Controller
$value = "'" . $value . "'";
}
- if (! preg_match("/[^a-zA-Z0-9_]+/", $_REQUEST['varName'])
+ if (! preg_match("/[^a-zA-Z0-9_]+/", $_POST['varName'])
&& $this->dbi->query(
- 'SET GLOBAL ' . $_REQUEST['varName'] . ' = ' . $value
+ 'SET GLOBAL ' . $_POST['varName'] . ' = ' . $value
)
) {
// Some values are rounded down etc.
$varValue = $this->dbi->fetchSingleRow(
'SHOW GLOBAL VARIABLES WHERE Variable_name="'
- . $this->dbi->escapeString($_REQUEST['varName'])
+ . $this->dbi->escapeString($_POST['varName'])
. '";',
'NUM'
);
list($formattedValue, $isHtmlFormatted) = $this->_formatVariable(
- $_REQUEST['varName'],
+ $_POST['varName'],
$varValue[1]
);
diff --git a/libraries/classes/Controllers/Table/TableIndexesController.php b/libraries/classes/Controllers/Table/TableIndexesController.php
index 9552943f34..b76356f985 100644
--- a/libraries/classes/Controllers/Table/TableIndexesController.php
+++ b/libraries/classes/Controllers/Table/TableIndexesController.php
@@ -55,7 +55,7 @@ class TableIndexesController extends TableController
*/
public function indexAction()
{
- if (isset($_REQUEST['do_save_data'])) {
+ if (isset($_POST['do_save_data'])) {
$this->doSaveDataAction();
return;
} // end builds the new index
@@ -72,24 +72,24 @@ class TableIndexesController extends TableController
{
$this->dbi->selectDb($GLOBALS['db']);
$add_fields = 0;
- if (isset($_REQUEST['index']) && is_array($_REQUEST['index'])) {
+ if (isset($_POST['index']) && is_array($_POST['index'])) {
// coming already from form
- if (isset($_REQUEST['index']['columns']['names'])) {
- $add_fields = count($_REQUEST['index']['columns']['names'])
+ if (isset($_POST['index']['columns']['names'])) {
+ $add_fields = count($_POST['index']['columns']['names'])
- $this->index->getColumnCount();
}
- if (isset($_REQUEST['add_fields'])) {
- $add_fields += $_REQUEST['added_fields'];
+ if (isset($_POST['add_fields'])) {
+ $add_fields += $_POST['added_fields'];
}
- } elseif (isset($_REQUEST['create_index'])) {
- $add_fields = $_REQUEST['added_fields'];
+ } elseif (isset($_POST['create_index'])) {
+ $add_fields = $_POST['added_fields'];
} // end preparing form values
// Get fields and stores their name/type
- if (isset($_REQUEST['create_edit_table'])) {
- $fields = json_decode($_REQUEST['columns'], true);
+ if (isset($_POST['create_edit_table'])) {
+ $fields = json_decode($_POST['columns'], true);
$index_params = [
- 'Non_unique' => $_REQUEST['index']['Index_choice'] == 'UNIQUE'
+ 'Non_unique' => $_POST['index']['Index_choice'] == 'UNIQUE'
? '0' : '1',
];
$this->index->set($index_params);
@@ -104,12 +104,12 @@ class TableIndexesController extends TableController
'table' => $this->table,
];
- if (isset($_REQUEST['create_index'])) {
+ if (isset($_POST['create_index'])) {
$form_params['create_index'] = 1;
- } elseif (isset($_REQUEST['old_index'])) {
- $form_params['old_index'] = $_REQUEST['old_index'];
- } elseif (isset($_REQUEST['index'])) {
- $form_params['old_index'] = $_REQUEST['index'];
+ } elseif (isset($_POST['old_index'])) {
+ $form_params['old_index'] = $_POST['old_index'];
+ } elseif (isset($_POST['index'])) {
+ $form_params['old_index'] = $_POST['index'];
}
$this->response->getHeader()->getScripts()->addFile('indexes.js');
@@ -120,7 +120,7 @@ class TableIndexesController extends TableController
'index' => $this->index,
'form_params' => $form_params,
'add_fields' => $add_fields,
- 'create_edit_table' => isset($_REQUEST['create_edit_table']),
+ 'create_edit_table' => isset($_POST['create_edit_table']),
'default_sliders_state' => $GLOBALS['cfg']['InitialSlidersState'],
])
);
@@ -141,7 +141,7 @@ class TableIndexesController extends TableController
->getSqlQueryForIndexCreateOrEdit($this->index, $error);
// If there is a request for SQL previewing.
- if (isset($_REQUEST['preview_sql'])) {
+ if (isset($_POST['preview_sql'])) {
$this->response->addJSON(
'sql_data',
$this->template->render('preview_sql', ['query_data' => $sql_query])
diff --git a/libraries/classes/Controllers/Table/TableRelationController.php b/libraries/classes/Controllers/Table/TableRelationController.php
index 2982f91f95..c95e718335 100644
--- a/libraries/classes/Controllers/Table/TableRelationController.php
+++ b/libraries/classes/Controllers/Table/TableRelationController.php
@@ -105,11 +105,11 @@ class TableRelationController extends TableController
{
// Send table of column names to populate corresponding dropdowns depending
// on the current selection
- if (isset($_REQUEST['getDropdownValues'])
- && $_REQUEST['getDropdownValues'] === 'true'
+ if (isset($_POST['getDropdownValues'])
+ && $_POST['getDropdownValues'] === 'true'
) {
// if both db and table are selected
- if (isset($_REQUEST['foreignTable'])) {
+ if (isset($_POST['foreignTable'])) {
$this->getDropdownValueForTableAction();
} else { // if only the db is selected
$this->getDropdownValueForDbAction();
@@ -241,8 +241,8 @@ class TableRelationController extends TableController
*/
public function updateForForeignKeysAction()
{
- $multi_edit_columns_name = isset($_REQUEST['foreign_key_fields_name'])
- ? $_REQUEST['foreign_key_fields_name']
+ $multi_edit_columns_name = isset($_POST['foreign_key_fields_name'])
+ ? $_POST['foreign_key_fields_name']
: null;
// (for now, one index name only; we keep the definitions if the
@@ -262,7 +262,7 @@ class TableRelationController extends TableController
$this->response->addHTML($html);
// If there is a request for SQL previewing.
- if (isset($_REQUEST['preview_sql'])) {
+ if (isset($_POST['preview_sql'])) {
Core::previewSQL($preview_sql_data);
}
@@ -285,8 +285,8 @@ class TableRelationController extends TableController
*/
public function updateForInternalRelationAction()
{
- $multi_edit_columns_name = isset($_REQUEST['fields_name'])
- ? $_REQUEST['fields_name']
+ $multi_edit_columns_name = isset($_POST['fields_name'])
+ ? $_POST['fields_name']
: null;
if ($this->upd_query->updateInternalRelations(
@@ -316,8 +316,8 @@ class TableRelationController extends TableController
*/
public function getDropdownValueForTableAction()
{
- $foreignTable = $_REQUEST['foreignTable'];
- $table_obj = $this->dbi->getTable($_REQUEST['foreignDb'], $foreignTable);
+ $foreignTable = $_POST['foreignTable'];
+ $table_obj = $this->dbi->getTable($_POST['foreignDb'], $foreignTable);
// Since views do not have keys defined on them provide the full list of
// columns
if ($table_obj->isView()) {
@@ -335,7 +335,7 @@ class TableRelationController extends TableController
$this->response->addJSON('columns', $columns);
// @todo should be: $server->db($db)->table($table)->primary()
- $primary = Index::getPrimary($foreignTable, $_REQUEST['foreignDb']);
+ $primary = Index::getPrimary($foreignTable, $_POST['foreignDb']);
if (false === $primary) {
return;
}
@@ -352,11 +352,11 @@ class TableRelationController extends TableController
public function getDropdownValueForDbAction()
{
$tables = [];
- $foreign = isset($_REQUEST['foreign']) && $_REQUEST['foreign'] === 'true';
+ $foreign = isset($_POST['foreign']) && $_POST['foreign'] === 'true';
if ($foreign) {
$query = 'SHOW TABLE STATUS FROM '
- . Util::backquote($_REQUEST['foreignDb']);
+ . Util::backquote($_POST['foreignDb']);
$tables_rs = $this->dbi->query(
$query,
DatabaseInterface::CONNECT_USER,
@@ -372,7 +372,7 @@ class TableRelationController extends TableController
}
} else {
$query = 'SHOW TABLES FROM '
- . Util::backquote($_REQUEST['foreignDb']);
+ . Util::backquote($_POST['foreignDb']);
$tables_rs = $this->dbi->query(
$query,
DatabaseInterface::CONNECT_USER,
diff --git a/libraries/classes/Controllers/Table/TableSearchController.php b/libraries/classes/Controllers/Table/TableSearchController.php
index a0ef7bd31d..545cac0579 100644
--- a/libraries/classes/Controllers/Table/TableSearchController.php
+++ b/libraries/classes/Controllers/Table/TableSearchController.php
@@ -221,7 +221,7 @@ class TableSearchController extends TableController
]
);
- if (isset($_REQUEST['range_search'])) {
+ if (isset($_POST['range_search'])) {
$this->rangeSearchAction();
return;
@@ -262,8 +262,8 @@ class TableSearchController extends TableController
*
* @var boolean Object containing parameters for the POST request
*/
- if (isset($_REQUEST['get_data_row'])
- && $_REQUEST['get_data_row'] == true
+ if (isset($_POST['get_data_row'])
+ && $_POST['get_data_row'] == true
) {
$this->getDataRowAction();
@@ -275,8 +275,8 @@ class TableSearchController extends TableController
*
* @var boolean Object containing parameters for the POST request
*/
- if (isset($_REQUEST['change_tbl_info'])
- && $_REQUEST['change_tbl_info'] == true
+ if (isset($_POST['change_tbl_info'])
+ && $_POST['change_tbl_info'] == true
) {
$this->changeTableInfoAction();
@@ -407,7 +407,7 @@ class TableSearchController extends TableController
*/
public function changeTableInfoAction()
{
- $field = $_REQUEST['field'];
+ $field = $_POST['field'];
if ($field == 'pma_null') {
$this->response->addJSON('field_type', '');
$this->response->addJSON('field_collation', '');
@@ -417,8 +417,8 @@ class TableSearchController extends TableController
}
$key = array_search($field, $this->_columnNames);
$search_index
- = (isset($_REQUEST['it']) && is_numeric($_REQUEST['it'])
- ? intval($_REQUEST['it']) : 0);
+ = (isset($_POST['it']) && is_numeric($_POST['it'])
+ ? intval($_POST['it']) : 0);
$properties = $this->getColumnProperties($search_index, $key);
$this->response->addJSON(
@@ -438,8 +438,8 @@ class TableSearchController extends TableController
public function getDataRowAction()
{
$extra_data = [];
- $row_info_query = 'SELECT * FROM `' . $_REQUEST['db'] . '`.`'
- . $_REQUEST['table'] . '` WHERE ' . $_REQUEST['where_clause'];
+ $row_info_query = 'SELECT * FROM `' . $_POST['db'] . '`.`'
+ . $_POST['table'] . '` WHERE ' . $_POST['where_clause'];
$result = $this->dbi->query(
$row_info_query . ";",
DatabaseInterface::CONNECT_USER,
@@ -584,7 +584,7 @@ class TableSearchController extends TableController
*/
public function rangeSearchAction()
{
- $min_max = $this->getColumnMinMax($_REQUEST['column']);
+ $min_max = $this->getColumnMinMax($_POST['column']);
$this->response->addJSON('column_data', $min_max);
}
diff --git a/libraries/classes/Controllers/Table/TableStructureController.php b/libraries/classes/Controllers/Table/TableStructureController.php
index 23e2c5eeec..28781a7554 100644
--- a/libraries/classes/Controllers/Table/TableStructureController.php
+++ b/libraries/classes/Controllers/Table/TableStructureController.php
@@ -163,8 +163,8 @@ class TableStructureController extends TableController
/**
* Handle column moving
*/
- if (isset($_REQUEST['move_columns'])
- && is_array($_REQUEST['move_columns'])
+ if (isset($_POST['move_columns'])
+ && is_array($_POST['move_columns'])
&& $this->response->isAjax()
) {
$this->moveColumns();
@@ -174,9 +174,9 @@ class TableStructureController extends TableController
/**
* handle MySQL reserved words columns check
*/
- if (isset($_REQUEST['reserved_word_check'])) {
+ if (isset($_POST['reserved_word_check'])) {
if ($GLOBALS['cfg']['ReservedWordDisableWarning'] === false) {
- $columns_names = $_REQUEST['field_name'];
+ $columns_names = $_POST['field_name'];
$reserved_keywords_names = [];
foreach ($columns_names as $column) {
if (Context::isKeyword(trim($column), true)) {
@@ -208,7 +208,7 @@ class TableStructureController extends TableController
/**
* A click on Change has been made for one column
*/
- if (isset($_REQUEST['change_column'])) {
+ if (isset($_GET['change_column'])) {
$this->displayHtmlForColumnChange(null, 'tbl_structure.php');
return;
}
@@ -216,8 +216,8 @@ class TableStructureController extends TableController
/**
* Adding or editing partitioning of the table
*/
- if (isset($_REQUEST['edit_partitioning'])
- && ! isset($_REQUEST['save_partitioning'])
+ if (isset($_POST['edit_partitioning'])
+ && ! isset($_POST['save_partitioning'])
) {
$this->displayHtmlForPartitionChange();
return;
@@ -231,7 +231,7 @@ class TableStructureController extends TableController
$submit_mult = $this->getMultipleFieldCommandType();
if (! empty($submit_mult)) {
- if (isset($_REQUEST['selected_fld'])) {
+ if (isset($_POST['selected_fld'])) {
if ($submit_mult == 'browse') {
// browsing the table displaying only selected columns
$this->displayTableBrowseForSelectedColumns(
@@ -242,14 +242,14 @@ class TableStructureController extends TableController
// handle multiple field commands
// handle confirmation of deleting multiple columns
$action = 'tbl_structure.php';
- $GLOBALS['selected'] = $_REQUEST['selected_fld'];
+ $GLOBALS['selected'] = $_POST['selected_fld'];
list(
$what_ret, $query_type_ret, $is_unset_submit_mult,
$mult_btn_ret, $centralColsError
)
= $this->getDataForSubmitMult(
$submit_mult,
- $_REQUEST['selected_fld'],
+ $_POST['selected_fld'],
$action
);
//update the existing variables
@@ -291,29 +291,29 @@ class TableStructureController extends TableController
/**
* Modifications have been submitted -> updates the table
*/
- if (isset($_REQUEST['do_save_data'])) {
+ if (isset($_POST['do_save_data'])) {
$regenerate = $this->updateColumns();
if ($regenerate) {
// This happens when updating failed
// @todo: do something appropriate
} else {
// continue to show the table's structure
- unset($_REQUEST['selected']);
+ unset($_POST['selected']);
}
}
/**
* Modifications to the partitioning have been submitted -> updates the table
*/
- if (isset($_REQUEST['save_partitioning'])) {
+ if (isset($_POST['save_partitioning'])) {
$this->updatePartitioning();
}
/**
* Adding indexes
*/
- if (isset($_REQUEST['add_key'])
- || isset($_REQUEST['partition_maintenance'])
+ if (isset($_POST['add_key'])
+ || isset($_POST['partition_maintenance'])
) {
//todo: set some variables for sql.php include, to be eliminated
//after refactoring sql.php
@@ -402,8 +402,8 @@ class TableStructureController extends TableController
$changes = [];
// move columns from first to last
- for ($i = 0, $l = count($_REQUEST['move_columns']); $i < $l; $i++) {
- $column = $_REQUEST['move_columns'][$i];
+ for ($i = 0, $l = count($_POST['move_columns']); $i < $l; $i++) {
+ $column = $_POST['move_columns'][$i];
// is this column already correctly placed?
if ($column_names[$i] == $column) {
continue;
@@ -568,7 +568,7 @@ class TableStructureController extends TableController
protected function displayHtmlForPartitionChange()
{
$partitionDetails = null;
- if (! isset($_REQUEST['partition_by'])) {
+ if (! isset($_POST['partition_by'])) {
$partitionDetails = $this->_extractPartitionDetails();
}
@@ -788,18 +788,18 @@ class TableStructureController extends TableController
];
foreach ($types as $type) {
- if (isset($_REQUEST['submit_mult_' . $type . '_x'])) {
+ if (isset($_POST['submit_mult_' . $type . '_x'])) {
return $type;
}
}
- if (isset($_REQUEST['submit_mult'])) {
- return $_REQUEST['submit_mult'];
- } elseif (isset($_REQUEST['mult_btn'])
- && $_REQUEST['mult_btn'] == __('Yes')
+ if (isset($_POST['submit_mult'])) {
+ return $_POST['submit_mult'];
+ } elseif (isset($_POST['mult_btn'])
+ && $_POST['mult_btn'] == __('Yes')
) {
- if (isset($_REQUEST['selected'])) {
- $_REQUEST['selected_fld'] = $_REQUEST['selected'];
+ if (isset($_POST['selected'])) {
+ $_POST['selected_fld'] = $_POST['selected'];
}
return 'row_delete';
}
@@ -819,7 +819,7 @@ class TableStructureController extends TableController
{
$GLOBALS['active_page'] = 'sql.php';
$fields = [];
- foreach ($_REQUEST['selected_fld'] as $sval) {
+ foreach ($_POST['selected_fld'] as $sval) {
$fields[] = Util::backquote($sval);
}
$sql_query = sprintf(
@@ -877,7 +877,7 @@ class TableStructureController extends TableController
]
);
$regenerate = false;
- $field_cnt = count($_REQUEST['field_name']);
+ $field_cnt = count($_POST['field_name']);
$changes = [];
$adjust_privileges = [];
$columns_with_index = $this->dbi
@@ -891,20 +891,20 @@ class TableStructureController extends TableController
}
$changes[] = 'CHANGE ' . Table::generateAlter(
- Util::getValueByKey($_REQUEST, "field_orig.${i}", ''),
- $_REQUEST['field_name'][$i],
- $_REQUEST['field_type'][$i],
- $_REQUEST['field_length'][$i],
- $_REQUEST['field_attribute'][$i],
- Util::getValueByKey($_REQUEST, "field_collation.${i}", ''),
- Util::getValueByKey($_REQUEST, "field_null.${i}", 'NOT NULL'),
- $_REQUEST['field_default_type'][$i],
- $_REQUEST['field_default_value'][$i],
- Util::getValueByKey($_REQUEST, "field_extra.${i}", false),
- Util::getValueByKey($_REQUEST, "field_comments.${i}", ''),
- Util::getValueByKey($_REQUEST, "field_virtuality.${i}", ''),
- Util::getValueByKey($_REQUEST, "field_expression.${i}", ''),
- Util::getValueByKey($_REQUEST, "field_move_to.${i}", ''),
+ Util::getValueByKey($_POST, "field_orig.${i}", ''),
+ $_POST['field_name'][$i],
+ $_POST['field_type'][$i],
+ $_POST['field_length'][$i],
+ $_POST['field_attribute'][$i],
+ Util::getValueByKey($_POST, "field_collation.${i}", ''),
+ Util::getValueByKey($_POST, "field_null.${i}", 'NOT NULL'),
+ $_POST['field_default_type'][$i],
+ $_POST['field_default_value'][$i],
+ Util::getValueByKey($_POST, "field_extra.${i}", false),
+ Util::getValueByKey($_POST, "field_comments.${i}", ''),
+ Util::getValueByKey($_POST, "field_virtuality.${i}", ''),
+ Util::getValueByKey($_POST, "field_expression.${i}", ''),
+ Util::getValueByKey($_POST, "field_move_to.${i}", ''),
$columns_with_index
);
@@ -915,22 +915,22 @@ class TableStructureController extends TableController
// if the old column name is part of the remembered sort expression
if (mb_strpos(
(string) $sorted_col,
- Util::backquote($_REQUEST['field_orig'][$i])
+ Util::backquote($_POST['field_orig'][$i])
) !== false) {
// delete the whole remembered sort expression
$this->table_obj->removeUiProp(Table::PROP_SORTED_COLUMN);
}
- if (isset($_REQUEST['field_adjust_privileges'][$i])
- && ! empty($_REQUEST['field_adjust_privileges'][$i])
- && $_REQUEST['field_orig'][$i] != $_REQUEST['field_name'][$i]
+ if (isset($_POST['field_adjust_privileges'][$i])
+ && ! empty($_POST['field_adjust_privileges'][$i])
+ && $_POST['field_orig'][$i] != $_POST['field_name'][$i]
) {
- $adjust_privileges[$_REQUEST['field_orig'][$i]]
- = $_REQUEST['field_name'][$i];
+ $adjust_privileges[$_POST['field_orig'][$i]]
+ = $_POST['field_name'][$i];
}
} // end for
- if (count($changes) > 0 || isset($_REQUEST['preview_sql'])) {
+ if (count($changes) > 0 || isset($_POST['preview_sql'])) {
// Builds the primary keys statements and updates the table
$key_query = '';
/**
@@ -957,7 +957,7 @@ class TableStructureController extends TableController
$sql_query .= ';';
// If there is a request for SQL previewing.
- if (isset($_REQUEST['preview_sql'])) {
+ if (isset($_POST['preview_sql'])) {
Core::previewSQL(count($changes) > 0 ? $sql_query : '');
}
@@ -972,18 +972,18 @@ class TableStructureController extends TableController
// While changing the Column Collation
// First change to BLOB
for ($i = 0; $i < $field_cnt; $i++) {
- if (isset($_REQUEST['field_collation'][$i])
- && isset($_REQUEST['field_collation_orig'][$i])
- && $_REQUEST['field_collation'][$i] !== $_REQUEST['field_collation_orig'][$i]
- && ! in_array($_REQUEST['field_orig'][$i], $columns_with_index)
+ if (isset($_POST['field_collation'][$i])
+ && isset($_POST['field_collation_orig'][$i])
+ && $_POST['field_collation'][$i] !== $_POST['field_collation_orig'][$i]
+ && ! in_array($_POST['field_orig'][$i], $columns_with_index)
) {
$secondary_query = 'ALTER TABLE ' . Util::backquote(
$this->table
)
. ' CHANGE ' . Util::backquote(
- $_REQUEST['field_orig'][$i]
+ $_POST['field_orig'][$i]
)
- . ' ' . Util::backquote($_REQUEST['field_orig'][$i])
+ . ' ' . Util::backquote($_POST['field_orig'][$i])
. ' BLOB;';
$this->dbi->query($secondary_query);
$changedToBlob[$i] = true;
@@ -1028,20 +1028,20 @@ class TableStructureController extends TableController
for ($i = 0; $i < $field_cnt; $i++) {
if ($changedToBlob[$i]) {
$changes_revert[] = 'CHANGE ' . Table::generateAlter(
- Util::getValueByKey($_REQUEST, "field_orig.${i}", ''),
- $_REQUEST['field_name'][$i],
- $_REQUEST['field_type_orig'][$i],
- $_REQUEST['field_length_orig'][$i],
- $_REQUEST['field_attribute_orig'][$i],
- Util::getValueByKey($_REQUEST, "field_collation_orig.${i}", ''),
- Util::getValueByKey($_REQUEST, "field_null_orig.${i}", 'NOT NULL'),
- $_REQUEST['field_default_type_orig'][$i],
- $_REQUEST['field_default_value_orig'][$i],
- Util::getValueByKey($_REQUEST, "field_extra_orig.${i}", false),
- Util::getValueByKey($_REQUEST, "field_comments_orig.${i}", ''),
- Util::getValueByKey($_REQUEST, "field_virtuality_orig.${i}", ''),
- Util::getValueByKey($_REQUEST, "field_expression_orig.${i}", ''),
- Util::getValueByKey($_REQUEST, "field_move_to_orig.${i}", '')
+ Util::getValueByKey($_POST, "field_orig.${i}", ''),
+ $_POST['field_name'][$i],
+ $_POST['field_type_orig'][$i],
+ $_POST['field_length_orig'][$i],
+ $_POST['field_attribute_orig'][$i],
+ Util::getValueByKey($_POST, "field_collation_orig.${i}", ''),
+ Util::getValueByKey($_POST, "field_null_orig.${i}", 'NOT NULL'),
+ $_POST['field_default_type_orig'][$i],
+ $_POST['field_default_value_orig'][$i],
+ Util::getValueByKey($_POST, "field_extra_orig.${i}", false),
+ Util::getValueByKey($_POST, "field_comments_orig.${i}", ''),
+ Util::getValueByKey($_POST, "field_virtuality_orig.${i}", ''),
+ Util::getValueByKey($_POST, "field_expression_orig.${i}", ''),
+ Util::getValueByKey($_POST, "field_move_to_orig.${i}", '')
);
}
}
@@ -1066,37 +1066,37 @@ class TableStructureController extends TableController
}
// update field names in relation
- if (isset($_REQUEST['field_orig']) && is_array($_REQUEST['field_orig'])) {
- foreach ($_REQUEST['field_orig'] as $fieldindex => $fieldcontent) {
- if ($_REQUEST['field_name'][$fieldindex] != $fieldcontent) {
+ if (isset($_POST['field_orig']) && is_array($_POST['field_orig'])) {
+ foreach ($_POST['field_orig'] as $fieldindex => $fieldcontent) {
+ if ($_POST['field_name'][$fieldindex] != $fieldcontent) {
$this->relation->renameField(
$this->db,
$this->table,
$fieldcontent,
- $_REQUEST['field_name'][$fieldindex]
+ $_POST['field_name'][$fieldindex]
);
}
}
}
// update mime types
- if (isset($_REQUEST['field_mimetype'])
- && is_array($_REQUEST['field_mimetype'])
+ if (isset($_POST['field_mimetype'])
+ && is_array($_POST['field_mimetype'])
&& $GLOBALS['cfg']['BrowseMIME']
) {
- foreach ($_REQUEST['field_mimetype'] as $fieldindex => $mimetype) {
- if (isset($_REQUEST['field_name'][$fieldindex])
- && strlen($_REQUEST['field_name'][$fieldindex]) > 0
+ foreach ($_POST['field_mimetype'] as $fieldindex => $mimetype) {
+ if (isset($_POST['field_name'][$fieldindex])
+ && strlen($_POST['field_name'][$fieldindex]) > 0
) {
$this->transformations->setMime(
$this->db,
$this->table,
- $_REQUEST['field_name'][$fieldindex],
+ $_POST['field_name'][$fieldindex],
$mimetype,
- $_REQUEST['field_transformation'][$fieldindex],
- $_REQUEST['field_transformation_options'][$fieldindex],
- $_REQUEST['field_input_transformation'][$fieldindex],
- $_REQUEST['field_input_transformation_options'][$fieldindex]
+ $_POST['field_transformation'][$fieldindex],
+ $_POST['field_transformation_options'][$fieldindex],
+ $_POST['field_input_transformation'][$fieldindex],
+ $_POST['field_input_transformation_options'][$fieldindex]
);
}
}
@@ -1163,15 +1163,15 @@ class TableStructureController extends TableController
{
// these two fields are checkboxes so might not be part of the
// request; therefore we define them to avoid notices below
- if (! isset($_REQUEST['field_null'][$i])) {
- $_REQUEST['field_null'][$i] = 'NO';
+ if (! isset($_POST['field_null'][$i])) {
+ $_POST['field_null'][$i] = 'NO';
}
- if (! isset($_REQUEST['field_extra'][$i])) {
- $_REQUEST['field_extra'][$i] = '';
+ if (! isset($_POST['field_extra'][$i])) {
+ $_POST['field_extra'][$i] = '';
}
// field_name does not follow the convention (corresponds to field_orig)
- if ($_REQUEST['field_name'][$i] != $_REQUEST['field_orig'][$i]) {
+ if ($_POST['field_name'][$i] != $_POST['field_orig'][$i]) {
return true;
}
@@ -1181,11 +1181,11 @@ class TableStructureController extends TableController
'field_length', 'field_null', 'field_type'
];
foreach ($fields as $field) {
- if ($_REQUEST[$field][$i] != $_REQUEST[$field . '_orig'][$i]) {
+ if ($_POST[$field][$i] != $_POST[$field . '_orig'][$i]) {
return true;
}
}
- return !empty($_REQUEST['field_move_to'][$i]);
+ return !empty($_POST['field_move_to'][$i]);
}
/**
diff --git a/libraries/classes/CreateAddField.php b/libraries/classes/CreateAddField.php
index 86a7baf96d..fdb8f4a092 100644
--- a/libraries/classes/CreateAddField.php
+++ b/libraries/classes/CreateAddField.php
@@ -38,12 +38,12 @@ class CreateAddField
*/
private function getIndexedColumns(): array
{
- $fieldCount = count($_REQUEST['field_name']);
- $fieldPrimary = json_decode($_REQUEST['primary_indexes'], true);
- $fieldIndex = json_decode($_REQUEST['indexes'], true);
- $fieldUnique = json_decode($_REQUEST['unique_indexes'], true);
- $fieldFullText = json_decode($_REQUEST['fulltext_indexes'], true);
- $fieldSpatial = json_decode($_REQUEST['spatial_indexes'], true);
+ $fieldCount = count($_POST['field_name']);
+ $fieldPrimary = json_decode($_POST['primary_indexes'], true);
+ $fieldIndex = json_decode($_POST['indexes'], true);
+ $fieldUnique = json_decode($_POST['unique_indexes'], true);
+ $fieldFullText = json_decode($_POST['fulltext_indexes'], true);
+ $fieldSpatial = json_decode($_POST['spatial_indexes'], true);
return [
$fieldCount,
@@ -74,35 +74,35 @@ class CreateAddField
$previousField = -1;
for ($i = 0; $i < $fieldCount; ++$i) {
// '0' is also empty for php :-(
- if (strlen($_REQUEST['field_name'][$i]) === 0) {
+ if (strlen($_POST['field_name'][$i]) === 0) {
continue;
}
$definition = $this->getStatementPrefix($isCreateTable) .
Table::generateFieldSpec(
- trim($_REQUEST['field_name'][$i]),
- $_REQUEST['field_type'][$i],
- $_REQUEST['field_length'][$i],
- $_REQUEST['field_attribute'][$i],
- isset($_REQUEST['field_collation'][$i])
- ? $_REQUEST['field_collation'][$i]
+ trim($_POST['field_name'][$i]),
+ $_POST['field_type'][$i],
+ $_POST['field_length'][$i],
+ $_POST['field_attribute'][$i],
+ isset($_POST['field_collation'][$i])
+ ? $_POST['field_collation'][$i]
: '',
- isset($_REQUEST['field_null'][$i])
- ? $_REQUEST['field_null'][$i]
+ isset($_POST['field_null'][$i])
+ ? $_POST['field_null'][$i]
: 'NOT NULL',
- $_REQUEST['field_default_type'][$i],
- $_REQUEST['field_default_value'][$i],
- isset($_REQUEST['field_extra'][$i])
- ? $_REQUEST['field_extra'][$i]
+ $_POST['field_default_type'][$i],
+ $_POST['field_default_value'][$i],
+ isset($_POST['field_extra'][$i])
+ ? $_POST['field_extra'][$i]
: false,
- isset($_REQUEST['field_comments'][$i])
- ? $_REQUEST['field_comments'][$i]
+ isset($_POST['field_comments'][$i])
+ ? $_POST['field_comments'][$i]
: '',
- isset($_REQUEST['field_virtuality'][$i])
- ? $_REQUEST['field_virtuality'][$i]
+ isset($_POST['field_virtuality'][$i])
+ ? $_POST['field_virtuality'][$i]
: '',
- isset($_REQUEST['field_expression'][$i])
- ? $_REQUEST['field_expression'][$i]
+ isset($_POST['field_expression'][$i])
+ ? $_POST['field_expression'][$i]
: ''
);
@@ -136,22 +136,22 @@ class CreateAddField
return $sqlSuffix;
}
- if ((string) $_REQUEST['field_where'] === 'last') {
+ if ((string) $_POST['field_where'] === 'last') {
return $sqlSuffix;
}
// Only the first field can be added somewhere other than at the end
if ($previousField == -1) {
- if ((string) $_REQUEST['field_where'] === 'first') {
+ if ((string) $_POST['field_where'] === 'first') {
$sqlSuffix .= ' FIRST';
} else {
$sqlSuffix .= ' AFTER '
- . Util::backquote($_REQUEST['after_field']);
+ . Util::backquote($_POST['after_field']);
}
} else {
$sqlSuffix .= ' AFTER '
. Util::backquote(
- $_REQUEST['field_name'][$previousField]
+ $_POST['field_name'][$previousField]
);
}
@@ -189,7 +189,7 @@ class CreateAddField
$indexFields = [];
foreach ($index['columns'] as $key => $column) {
$indexFields[$key] = Util::backquote(
- $_REQUEST['field_name'][$column['col_index']]
+ $_POST['field_name'][$column['col_index']]
);
if ($column['size']) {
$indexFields[$key] .= '(' . $column['size'] . ')';
@@ -353,30 +353,30 @@ class CreateAddField
public function getPartitionsDefinition(): string
{
$sqlQuery = "";
- if (! empty($_REQUEST['partition_by'])
- && ! empty($_REQUEST['partition_expr'])
- && ! empty($_REQUEST['partition_count'])
- && $_REQUEST['partition_count'] > 1
+ if (! empty($_POST['partition_by'])
+ && ! empty($_POST['partition_expr'])
+ && ! empty($_POST['partition_count'])
+ && $_POST['partition_count'] > 1
) {
- $sqlQuery .= " PARTITION BY " . $_REQUEST['partition_by']
- . " (" . $_REQUEST['partition_expr'] . ")"
- . " PARTITIONS " . $_REQUEST['partition_count'];
+ $sqlQuery .= " PARTITION BY " . $_POST['partition_by']
+ . " (" . $_POST['partition_expr'] . ")"
+ . " PARTITIONS " . $_POST['partition_count'];
}
- if (! empty($_REQUEST['subpartition_by'])
- && ! empty($_REQUEST['subpartition_expr'])
- && ! empty($_REQUEST['subpartition_count'])
- && $_REQUEST['subpartition_count'] > 1
+ if (! empty($_POST['subpartition_by'])
+ && ! empty($_POST['subpartition_expr'])
+ && ! empty($_POST['subpartition_count'])
+ && $_POST['subpartition_count'] > 1
) {
- $sqlQuery .= " SUBPARTITION BY " . $_REQUEST['subpartition_by']
- . " (" . $_REQUEST['subpartition_expr'] . ")"
- . " SUBPARTITIONS " . $_REQUEST['subpartition_count'];
+ $sqlQuery .= " SUBPARTITION BY " . $_POST['subpartition_by']
+ . " (" . $_POST['subpartition_expr'] . ")"
+ . " SUBPARTITIONS " . $_POST['subpartition_count'];
}
- if (! empty($_REQUEST['partitions'])) {
+ if (! empty($_POST['partitions'])) {
$i = 0;
$partitions = [];
- foreach ($_REQUEST['partitions'] as $partition) {
+ foreach ($_POST['partitions'] as $partition) {
$partitions[] = $this->getPartitionDefinition($partition);
$i++;
}
@@ -468,24 +468,24 @@ class CreateAddField
. Util::backquote(trim($table)) . ' (' . $sqlStatement . ')';
// Adds table type, character set, comments and partition definition
- if (!empty($_REQUEST['tbl_storage_engine'])
- && ($_REQUEST['tbl_storage_engine'] != 'Default')
+ if (!empty($_POST['tbl_storage_engine'])
+ && ($_POST['tbl_storage_engine'] != 'Default')
) {
- $sqlQuery .= ' ENGINE = ' . $_REQUEST['tbl_storage_engine'];
+ $sqlQuery .= ' ENGINE = ' . $_POST['tbl_storage_engine'];
}
- if (!empty($_REQUEST['tbl_collation'])) {
- $sqlQuery .= Util::getCharsetQueryPart($_REQUEST['tbl_collation']);
+ if (!empty($_POST['tbl_collation'])) {
+ $sqlQuery .= Util::getCharsetQueryPart($_POST['tbl_collation']);
}
- if (! empty($_REQUEST['connection'])
- && ! empty($_REQUEST['tbl_storage_engine'])
- && $_REQUEST['tbl_storage_engine'] == 'FEDERATED'
+ if (! empty($_POST['connection'])
+ && ! empty($_POST['tbl_storage_engine'])
+ && $_POST['tbl_storage_engine'] == 'FEDERATED'
) {
$sqlQuery .= " CONNECTION = '"
- . $this->dbi->escapeString($_REQUEST['connection']) . "'";
+ . $this->dbi->escapeString($_POST['connection']) . "'";
}
- if (!empty($_REQUEST['comment'])) {
+ if (!empty($_POST['comment'])) {
$sqlQuery .= ' COMMENT = \''
- . $this->dbi->escapeString($_REQUEST['comment']) . '\'';
+ . $this->dbi->escapeString($_POST['comment']) . '\'';
}
$sqlQuery .= $this->getPartitionsDefinition();
$sqlQuery .= ';';
@@ -503,14 +503,14 @@ class CreateAddField
// Limit to 4096 fields (MySQL maximal value)
$mysqlLimit = 4096;
- if (isset($_REQUEST['submit_num_fields'])) { // adding new fields
- $numberOfFields = intval($_REQUEST['orig_num_fields']) + intval($_REQUEST['added_fields']);
- } elseif (isset($_REQUEST['orig_num_fields'])) { // retaining existing fields
- $numberOfFields = intval($_REQUEST['orig_num_fields']);
- } elseif (isset($_REQUEST['num_fields'])
- && intval($_REQUEST['num_fields']) > 0
+ if (isset($_POST['submit_num_fields'])) { // adding new fields
+ $numberOfFields = intval($_POST['orig_num_fields']) + intval($_POST['added_fields']);
+ } elseif (isset($_POST['orig_num_fields'])) { // retaining existing fields
+ $numberOfFields = intval($_POST['orig_num_fields']);
+ } elseif (isset($_POST['num_fields'])
+ && intval($_POST['num_fields']) > 0
) { // new table with specified number of fields
- $numberOfFields = intval($_REQUEST['num_fields']);
+ $numberOfFields = intval($_POST['num_fields']);
} else { // new table with unspecified number of fields
$numberOfFields = 4;
}
@@ -548,7 +548,7 @@ class CreateAddField
$sqlQuery = 'ALTER TABLE ' .
Util::backquote($table) . ' ' . $sqlStatement . ';';
// If there is a request for SQL previewing.
- if (isset($_REQUEST['preview_sql'])) {
+ if (isset($_POST['preview_sql'])) {
Core::previewSQL($sqlQuery);
}
return [$this->dbi->tryQuery($sqlQuery), $sqlQuery];
diff --git a/libraries/classes/Database/Qbe.php b/libraries/classes/Database/Qbe.php
index 1b0b5006d5..d2c8db86e6 100644
--- a/libraries/classes/Database/Qbe.php
+++ b/libraries/classes/Database/Qbe.php
@@ -271,7 +271,7 @@ class Qbe
}
$criterias = $this->_currentSearch->getCriterias();
- $_REQUEST = $criterias + $_REQUEST;
+ $_POST = $criterias + $_POST;
return $this;
}
@@ -296,34 +296,34 @@ class Qbe
$criteriaColumnCount = $this->_initializeCriteriasCount();
$this->_criteriaColumnInsert = Core::ifSetOr(
- $_REQUEST['criteriaColumnInsert'],
+ $_POST['criteriaColumnInsert'],
null,
'array'
);
$this->_criteriaColumnDelete = Core::ifSetOr(
- $_REQUEST['criteriaColumnDelete'],
+ $_POST['criteriaColumnDelete'],
null,
'array'
);
- $this->_prev_criteria = isset($_REQUEST['prev_criteria'])
- ? $_REQUEST['prev_criteria']
+ $this->_prev_criteria = isset($_POST['prev_criteria'])
+ ? $_POST['prev_criteria']
: [];
- $this->_criteria = isset($_REQUEST['criteria'])
- ? $_REQUEST['criteria']
+ $this->_criteria = isset($_POST['criteria'])
+ ? $_POST['criteria']
: array_fill(0, $criteriaColumnCount, '');
- $this->_criteriaRowInsert = isset($_REQUEST['criteriaRowInsert'])
- ? $_REQUEST['criteriaRowInsert']
+ $this->_criteriaRowInsert = isset($_POST['criteriaRowInsert'])
+ ? $_POST['criteriaRowInsert']
: array_fill(0, $criteriaColumnCount, '');
- $this->_criteriaRowDelete = isset($_REQUEST['criteriaRowDelete'])
- ? $_REQUEST['criteriaRowDelete']
+ $this->_criteriaRowDelete = isset($_POST['criteriaRowDelete'])
+ ? $_POST['criteriaRowDelete']
: array_fill(0, $criteriaColumnCount, '');
- $this->_criteriaAndOrRow = isset($_REQUEST['criteriaAndOrRow'])
- ? $_REQUEST['criteriaAndOrRow']
+ $this->_criteriaAndOrRow = isset($_POST['criteriaAndOrRow'])
+ ? $_POST['criteriaAndOrRow']
: array_fill(0, $criteriaColumnCount, '');
- $this->_criteriaAndOrColumn = isset($_REQUEST['criteriaAndOrColumn'])
- ? $_REQUEST['criteriaAndOrColumn']
+ $this->_criteriaAndOrColumn = isset($_POST['criteriaAndOrColumn'])
+ ? $_POST['criteriaAndOrColumn']
: array_fill(0, $criteriaColumnCount, '');
// sets minimum width
$this->_form_column_width = 12;
@@ -343,8 +343,8 @@ class Qbe
private function _setCriteriaTablesAndColumns()
{
// The tables list sent by a previously submitted form
- if (Core::isValid($_REQUEST['TableList'], 'array')) {
- foreach ($_REQUEST['TableList'] as $each_table) {
+ if (Core::isValid($_POST['TableList'], 'array')) {
+ foreach ($_POST['TableList'] as $each_table) {
$this->_criteriaTables[$each_table] = ' selected="selected"';
}
} // end if
@@ -363,7 +363,7 @@ class Qbe
$columns = $this->dbi->getColumns($this->_db, $table);
if (empty($this->_criteriaTables[$table])
- && ! empty($_REQUEST['TableList'])
+ && ! empty($_POST['TableList'])
) {
$this->_criteriaTables[$table] = '';
} else {
@@ -490,10 +490,10 @@ class Qbe
continue;
}
$selected = '';
- if (isset($_REQUEST['criteriaColumn'][$column_index])) {
- $selected = $_REQUEST['criteriaColumn'][$column_index];
+ if (isset($_POST['criteriaColumn'][$column_index])) {
+ $selected = $_POST['criteriaColumn'][$column_index];
$this->_formColumns[$new_column_count]
- = $_REQUEST['criteriaColumn'][$column_index];
+ = $_POST['criteriaColumn'][$column_index];
}
$html_output .= $this->_showColumnSelectCell(
$new_column_count,
@@ -539,10 +539,10 @@ class Qbe
}
$tmp_alias = '';
- if (! empty($_REQUEST['criteriaAlias'][$colInd])) {
+ if (! empty($_POST['criteriaAlias'][$colInd])) {
$tmp_alias
= $this->_formAliases[$new_column_count]
- = $_REQUEST['criteriaAlias'][$colInd];
+ = $_POST['criteriaAlias'][$colInd];
}// end if
$html_output .= '