Merge branch 'QA_4_8'

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
This commit is contained in:
Maurício Meneghini Fauth 2018-12-12 21:04:19 -02:00
commit 76d8bfdafa
129 changed files with 2168 additions and 2090 deletions

View File

@ -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'

View File

@ -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);

View File

@ -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 : ''

View File

@ -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']);
}

View File

@ -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;
}

View File

@ -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,

View File

@ -60,8 +60,8 @@ if ($num_tables < 1) {
} // end if
$multi_values = '<div class="export_table_list_container">';
if (isset($_GET['structure_or_data_forced'])) {
$force_val = htmlspecialchars($_GET['structure_or_data_forced']);
if (isset($_POST['structure_or_data_forced'])) {
$force_val = htmlspecialchars($_POST['structure_or_data_forced']);
} else {
$force_val = 0;
}
@ -88,20 +88,20 @@ if (!empty($_POST['selected_tbl']) && empty($table_select)) {
$table_select = $_POST['selected_tbl'];
}
// Check if the selected tables are defined in $_GET
// Check if the selected tables are defined in $_POST
// (from clicking Back button on export.php)
foreach (['table_select', 'table_structure', 'table_data'] as $one_key) {
if (isset($_GET[$one_key])) {
$_GET[$one_key] = urldecode($_GET[$one_key]);
$_GET[$one_key] = explode(",", $_GET[$one_key]);
if (isset($_POST[$one_key])) {
$_POST[$one_key] = urldecode($_POST[$one_key]);
$_POST[$one_key] = explode(",", $_POST[$one_key]);
}
}
foreach ($tables as $each_table) {
if (isset($_GET['table_select']) && is_array($_GET['table_select'])) {
if (isset($_POST['table_select']) && is_array($_POST['table_select'])) {
$is_checked = $export->getCheckedClause(
$each_table['Name'],
$_GET['table_select']
$_POST['table_select']
);
} elseif (isset($table_select)) {
$is_checked = $export->getCheckedClause(
@ -111,18 +111,18 @@ foreach ($tables as $each_table) {
} else {
$is_checked = ' checked="checked"';
}
if (isset($_GET['table_structure']) && is_array($_GET['table_structure'])) {
if (isset($_POST['table_structure']) && is_array($_POST['table_structure'])) {
$structure_checked = $export->getCheckedClause(
$each_table['Name'],
$_GET['table_structure']
$_POST['table_structure']
);
} else {
$structure_checked = $is_checked;
}
if (isset($_GET['table_data']) && is_array($_GET['table_data'])) {
if (isset($_POST['table_data']) && is_array($_POST['table_data'])) {
$data_checked = $export->getCheckedClause(
$each_table['Name'],
$_GET['table_data']
$_POST['table_data']
);
} else {
$data_checked = $is_checked;

View File

@ -50,31 +50,31 @@ $relationCleanup = new RelationCleanup($GLOBALS['dbi'], $relation);
* Rename/move or copy database
*/
if (strlen($GLOBALS['db']) > 0
&& (! empty($_REQUEST['db_rename']) || ! empty($_REQUEST['db_copy']))
&& (! empty($_POST['db_rename']) || ! empty($_POST['db_copy']))
) {
if (! empty($_REQUEST['db_rename'])) {
if (! empty($_POST['db_rename'])) {
$move = true;
} else {
$move = false;
}
if (! isset($_REQUEST['newname']) || strlen($_REQUEST['newname']) === 0) {
if (! isset($_POST['newname']) || strlen($_POST['newname']) === 0) {
$message = Message::error(__('The database name is empty!'));
} else {
// lower_case_table_names=1 `DB` becomes `db`
if ($GLOBALS['dbi']->getLowerCaseNames() === '1') {
$_REQUEST['newname'] = mb_strtolower(
$_REQUEST['newname']
$_POST['newname'] = mb_strtolower(
$_POST['newname']
);
}
if ($_REQUEST['newname'] === $_REQUEST['db']) {
if ($_POST['newname'] === $_REQUEST['db']) {
$message = Message::error(
__('Cannot copy database to the same name. Change the name and try again.')
);
} else {
$_error = false;
if ($move || ! empty($_REQUEST['create_database_before_copying'])) {
if ($move || ! empty($_POST['create_database_before_copying'])) {
$operations->createDbBeforeCopy();
}
@ -143,10 +143,10 @@ if (strlen($GLOBALS['db']) > 0
$operations->duplicateBookmarks($_error, $GLOBALS['db']);
if (! $_error && $move) {
if (isset($_REQUEST['adjust_privileges'])
&& ! empty($_REQUEST['adjust_privileges'])
if (isset($_POST['adjust_privileges'])
&& ! empty($_POST['adjust_privileges'])
) {
$operations->adjustPrivilegesMoveDb($GLOBALS['db'], $_REQUEST['newname']);
$operations->adjustPrivilegesMoveDb($GLOBALS['db'], $_POST['newname']);
}
/**
@ -164,19 +164,19 @@ if (strlen($GLOBALS['db']) > 0
__('Database %1$s has been renamed to %2$s.')
);
$message->addParam($GLOBALS['db']);
$message->addParam($_REQUEST['newname']);
$message->addParam($_POST['newname']);
} elseif (! $_error) {
if (isset($_REQUEST['adjust_privileges'])
&& ! empty($_REQUEST['adjust_privileges'])
if (isset($_POST['adjust_privileges'])
&& ! empty($_POST['adjust_privileges'])
) {
$operations->adjustPrivilegesCopyDb($GLOBALS['db'], $_REQUEST['newname']);
$operations->adjustPrivilegesCopyDb($GLOBALS['db'], $_POST['newname']);
}
$message = Message::success(
__('Database %1$s has been copied to %2$s.')
);
$message->addParam($GLOBALS['db']);
$message->addParam($_REQUEST['newname']);
$message->addParam($_POST['newname']);
} else {
$message = Message::error();
}
@ -184,13 +184,13 @@ if (strlen($GLOBALS['db']) > 0
/* Change database to be used */
if (! $_error && $move) {
$GLOBALS['db'] = $_REQUEST['newname'];
$GLOBALS['db'] = $_POST['newname'];
} elseif (! $_error) {
if (isset($_REQUEST['switch_to_new'])
&& $_REQUEST['switch_to_new'] == 'true'
if (isset($_POST['switch_to_new'])
&& $_POST['switch_to_new'] == 'true'
) {
$_SESSION['pma_switch_to_new'] = true;
$GLOBALS['db'] = $_REQUEST['newname'];
$GLOBALS['db'] = $_POST['newname'];
} else {
$_SESSION['pma_switch_to_new'] = false;
}
@ -205,7 +205,7 @@ if (strlen($GLOBALS['db']) > 0
if ($response->isAjax()) {
$response->setRequestStatus($message->isSuccess());
$response->addJSON('message', $message);
$response->addJSON('newname', $_REQUEST['newname']);
$response->addJSON('newname', $_POST['newname']);
$response->addJSON(
'sql_query',
Util::getMessage(null, $sql_query)
@ -224,8 +224,8 @@ $cfgRelation = $relation->getRelationsParam();
* Check if comments were updated
* (must be done before displaying the menu tabs)
*/
if (isset($_REQUEST['comment'])) {
$relation->setDbComment($GLOBALS['db'], $_REQUEST['comment']);
if (isset($_POST['comment'])) {
$relation->setDbComment($GLOBALS['db'], $_POST['comment']);
}
require 'libraries/db_common.inc.php';
@ -253,7 +253,7 @@ if (isset($message)) {
unset($message);
}
$_REQUEST['db_collation'] = $GLOBALS['dbi']->getDbCollation($GLOBALS['db']);
$db_collation = $GLOBALS['dbi']->getDbCollation($GLOBALS['db']);
$is_information_schema = $GLOBALS['dbi']->isSystemSchema($GLOBALS['db']);
if (!$is_information_schema) {
@ -272,7 +272,7 @@ if (!$is_information_schema) {
* rename database
*/
if ($GLOBALS['db'] != 'mysql') {
$response->addHTML($operations->getHtmlForRenameDatabase($GLOBALS['db']));
$response->addHTML($operations->getHtmlForRenameDatabase($GLOBALS['db'], $db_collation));
}
// Drop link if allowed
@ -288,12 +288,12 @@ if (!$is_information_schema) {
/**
* Copy database
*/
$response->addHTML($operations->getHtmlForCopyDatabase($GLOBALS['db']));
$response->addHTML($operations->getHtmlForCopyDatabase($GLOBALS['db'], $db_collation));
/**
* Change database charset
*/
$response->addHTML($operations->getHtmlForChangeDatabaseCharset($GLOBALS['db'], $table));
$response->addHTML($operations->getHtmlForChangeDatabaseCharset($GLOBALS['db'], $db_collation));
if (! $cfgRelation['allworks']
&& $cfg['PmaNoRelation_DisableWarning'] == false
@ -304,7 +304,7 @@ if (!$is_information_schema) {
'%sFind out why%s.'
)
);
$message->addParamHtml('<a href="./chk_rel.php' . $url_query . '">');
$message->addParamHtml('<a href="./chk_rel.php" data-post="' . $url_query . '">');
$message->addParamHtml('</a>');
/* Show error if user has configured something, notice elsewhere */
if (!empty($cfg['Servers'][$server]['pmadb'])) {

View File

@ -40,36 +40,36 @@ if ($cfgRelation['savedsearcheswork']) {
//Get saved search list.
$savedSearch = new SavedSearches($GLOBALS);
$savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
->setDbname($_REQUEST['db']);
->setDbname($GLOBALS['db']);
if (!empty($_REQUEST['searchId'])) {
$savedSearch->setId($_REQUEST['searchId']);
if (!empty($_POST['searchId'])) {
$savedSearch->setId($_POST['searchId']);
}
//Action field is sent.
if (isset($_REQUEST['action'])) {
$savedSearch->setSearchName($_REQUEST['searchName']);
if ('create' === $_REQUEST['action']) {
if (isset($_POST['action'])) {
$savedSearch->setSearchName($_POST['searchName']);
if ('create' === $_POST['action']) {
$saveResult = $savedSearch->setId(null)
->setCriterias($_REQUEST)
->setCriterias($_POST)
->save();
} elseif ('update' === $_REQUEST['action']) {
$saveResult = $savedSearch->setCriterias($_REQUEST)
} elseif ('update' === $_POST['action']) {
$saveResult = $savedSearch->setCriterias($_POST)
->save();
} elseif ('delete' === $_REQUEST['action']) {
} elseif ('delete' === $_POST['action']) {
$deleteResult = $savedSearch->delete();
//After deletion, reset search.
$savedSearch = new SavedSearches($GLOBALS);
$savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
->setDbname($_REQUEST['db']);
$_REQUEST = [];
} elseif ('load' === $_REQUEST['action']) {
if (empty($_REQUEST['searchId'])) {
->setDbname($GLOBALS['db']);
$_POST = [];
} elseif ('load' === $_POST['action']) {
if (empty($_POST['searchId'])) {
//when not loading a search, reset the object.
$savedSearch = new SavedSearches($GLOBALS);
$savedSearch->setUsername($GLOBALS['cfg']['Server']['user'])
->setDbname($_REQUEST['db']);
$_REQUEST = [];
->setDbname($GLOBALS['db']);
$_POST = [];
} else {
$loadResult = $savedSearch->load();
}
@ -85,7 +85,7 @@ if ($cfgRelation['savedsearcheswork']) {
* A query has been submitted -> (maybe) execute it
*/
$message_to_display = false;
if (isset($_REQUEST['submit_sql']) && ! empty($sql_query)) {
if (isset($_POST['submit_sql']) && ! empty($sql_query)) {
if (! preg_match('@^SELECT@i', $sql_query)) {
$message_to_display = true;
} else {
@ -94,7 +94,7 @@ if (isset($_REQUEST['submit_sql']) && ! empty($sql_query)) {
$sql->executeQueryAndSendQueryResponse(
null, // analyzed_sql_results
false, // is_gotofile
$_REQUEST['db'], // db
$_POST['db'], // db
null, // table
false, // find_real_end
null, // sql_query_for_bookmark

View File

@ -58,7 +58,7 @@ if (! $response->isAjax()) {
}
// Main search form has been submitted, get results
if (isset($_REQUEST['submit_search'])) {
if (isset($_POST['submit_search'])) {
$response->addHTML($db_search->getSearchResults());
}

View File

@ -44,8 +44,8 @@ $response->addHTML(
$sqlQueryForm->getHtml(
true,
false,
isset($_REQUEST['delimiter'])
? htmlspecialchars($_REQUEST['delimiter'])
isset($_POST['delimiter'])
? htmlspecialchars($_POST['delimiter'])
: ';'
)
);

View File

@ -34,6 +34,8 @@ $tracking = new Tracking();
*/
require 'libraries/db_common.inc.php';
$url_query .= '&amp;goto=tbl_tracking.php&amp;back=db_tracking.php';
$url_params['goto'] = 'tbl_tracking.php';
$url_params['back'] = 'db_tracking.php';
// Get the database structure
$sub_part = '_structure';
@ -50,39 +52,37 @@ list(
$pos
) = Util::getDbInfo($db, is_null($sub_part) ? '' : $sub_part);
// Work to do?
// (here, do not use $_REQUEST['db] as it can be crafted)
if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
Tracker::deleteTracking($GLOBALS['db'], $_REQUEST['table']);
if (isset($_POST['delete_tracking']) && isset($_POST['table'])) {
Tracker::deleteTracking($GLOBALS['db'], $_POST['table']);
Message::success(
__('Tracking data deleted successfully.')
)->display();
} elseif (isset($_REQUEST['submit_create_version'])) {
$tracking->createTrackingForMultipleTables($_REQUEST['selected']);
} elseif (isset($_POST['submit_create_version'])) {
$tracking->createTrackingForMultipleTables($_POST['selected']);
Message::success(
sprintf(
__(
'Version %1$s was created for selected tables,'
. ' tracking is active for them.'
),
htmlspecialchars($_REQUEST['version'])
htmlspecialchars($_POST['version'])
)
)->display();
} elseif (isset($_REQUEST['submit_mult'])) {
if (! empty($_REQUEST['selected_tbl'])) {
if ($_REQUEST['submit_mult'] == 'delete_tracking') {
foreach ($_REQUEST['selected_tbl'] as $table) {
} elseif (isset($_POST['submit_mult'])) {
if (! empty($_POST['selected_tbl'])) {
if ($_POST['submit_mult'] == 'delete_tracking') {
foreach ($_POST['selected_tbl'] as $table) {
Tracker::deleteTracking($GLOBALS['db'], $table);
}
Message::success(
__('Tracking data deleted successfully.')
)->display();
} elseif ($_REQUEST['submit_mult'] == 'track') {
} elseif ($_POST['submit_mult'] == 'track') {
echo $tracking->getHtmlForDataDefinitionAndManipulationStatements(
'db_tracking.php' . $url_query,
0,
$GLOBALS['db'],
$_REQUEST['selected_tbl']
$_POST['selected_tbl']
);
exit;
}
@ -94,7 +94,7 @@ if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
}
// Get tracked data about the database
$data = Tracker::getTrackedData($_REQUEST['db'], '', '1');
$data = Tracker::getTrackedData($GLOBALS['db'], '', '1');
// No tables present and no log exist
if ($num_tables == 0 && count($data['ddlog']) == 0) {
@ -109,7 +109,6 @@ if ($num_tables == 0 && count($data['ddlog']) == 0) {
// ---------------------------------------------------------------------------
echo $tracking->getHtmlForDbTrackingTables(
$GLOBALS['db'],
$_REQUEST['db'],
$url_query,
$pmaThemeImage,
$text_dir

View File

@ -15,8 +15,8 @@ use PhpMyAdmin\Utils\HttpRequest;
require_once 'libraries/common.inc.php';
if (!isset($_REQUEST['exception_type'])
|| !in_array($_REQUEST['exception_type'], ['js', 'php'])
if (!isset($_POST['exception_type'])
|| !in_array($_POST['exception_type'], ['js', 'php'])
) {
die('Oops, something went wrong!!');
}
@ -25,11 +25,11 @@ $response = Response::getInstance();
$errorReport = new ErrorReport(new HttpRequest());
if (isset($_REQUEST['send_error_report'])
&& ($_REQUEST['send_error_report'] == true
|| $_REQUEST['send_error_report'] == '1')
if (isset($_POST['send_error_report'])
&& ($_POST['send_error_report'] == true
|| $_POST['send_error_report'] == '1')
) {
if ($_REQUEST['exception_type'] == 'php') {
if ($_POST['exception_type'] == 'php') {
/**
* Prevent infinite error submission.
* Happens in case error submissions fails.
@ -53,7 +53,7 @@ if (isset($_REQUEST['send_error_report'])
);
}
}
$reportData = $errorReport->getData($_REQUEST['exception_type']);
$reportData = $errorReport->getData($_POST['exception_type']);
// report if and only if there were 'actual' errors.
if (count($reportData) > 0) {
$server_response = $errorReport->send($reportData);
@ -67,8 +67,8 @@ if (isset($_REQUEST['send_error_report'])
/* Message to show to the user */
if ($success) {
if ((isset($_REQUEST['automatic'])
&& $_REQUEST['automatic'] === "true")
if ((isset($_POST['automatic'])
&& $_POST['automatic'] === "true")
|| $GLOBALS['cfg']['SendErrorReports'] == 'always'
) {
$msg = __(
@ -100,35 +100,35 @@ if (isset($_REQUEST['send_error_report'])
/* Add message to response */
if ($response->isAjax()) {
if ($_REQUEST['exception_type'] == 'js') {
if ($_POST['exception_type'] == 'js') {
$response->addJSON('message', $msg);
} else {
$response->addJSON('_errSubmitMsg', $msg);
}
} elseif ($_REQUEST['exception_type'] == 'php') {
} elseif ($_POST['exception_type'] == 'php') {
$jsCode = 'PMA_ajaxShowMessage("<div class=\"error\">'
. $msg
. '</div>", false);';
$response->getFooter()->getScripts()->addCode($jsCode);
}
if ($_REQUEST['exception_type'] == 'php') {
if ($_POST['exception_type'] == 'php') {
// clear previous errors & save new ones.
$GLOBALS['error_handler']->savePreviousErrors();
}
/* Persist always send settings */
if (isset($_REQUEST['always_send'])
&& $_REQUEST['always_send'] === "true"
if (isset($_POST['always_send'])
&& $_POST['always_send'] === "true"
) {
$userPreferences = new UserPreferences();
$userPreferences->persistOption("SendErrorReports", "always", "ask");
}
}
} elseif (! empty($_REQUEST['get_settings'])) {
} elseif (! empty($_POST['get_settings'])) {
$response->addJSON('report_setting', $GLOBALS['cfg']['SendErrorReports']);
} else {
if ($_REQUEST['exception_type'] == 'js') {
if ($_POST['exception_type'] == 'js') {
$response->addHTML($errorReport->getForm());
} else {
// clear previous errors & save new ones.

View File

@ -232,39 +232,39 @@ $filename = '';
$separate_files = '';
// Is it a quick or custom export?
if (isset($_REQUEST['quick_or_custom'])
&& $_REQUEST['quick_or_custom'] == 'quick'
if (isset($_POST['quick_or_custom'])
&& $_POST['quick_or_custom'] == 'quick'
) {
$quick_export = true;
} else {
$quick_export = false;
}
if ($_REQUEST['output_format'] == 'astext') {
if ($_POST['output_format'] == 'astext') {
$asfile = false;
} else {
$asfile = true;
if (isset($_REQUEST['as_separate_files'])
&& ! empty($_REQUEST['as_separate_files'])
if (isset($_POST['as_separate_files'])
&& ! empty($_POST['as_separate_files'])
) {
if (isset($_REQUEST['compression'])
&& ! empty($_REQUEST['compression'])
&& $_REQUEST['compression'] == 'zip'
if (isset($_POST['compression'])
&& ! empty($_POST['compression'])
&& $_POST['compression'] == 'zip'
) {
$separate_files = $_REQUEST['as_separate_files'];
$separate_files = $_POST['as_separate_files'];
}
}
if (in_array($_REQUEST['compression'], $compression_methods)) {
$compression = $_REQUEST['compression'];
if (in_array($_POST['compression'], $compression_methods)) {
$compression = $_POST['compression'];
$buffer_needed = true;
}
if (($quick_export && ! empty($_REQUEST['quick_export_onserver']))
|| (! $quick_export && ! empty($_REQUEST['onserver']))
if (($quick_export && ! empty($_POST['quick_export_onserver']))
|| (! $quick_export && ! empty($_POST['onserver']))
) {
if ($quick_export) {
$onserver = $_REQUEST['quick_export_onserver'];
$onserver = $_POST['quick_export_onserver'];
} else {
$onserver = $_REQUEST['onserver'];
$onserver = $_POST['onserver'];
}
// Will we save dump on server?
$save_on_server = ! empty($cfg['SaveDir']) && $onserver;
@ -302,9 +302,9 @@ if ((!empty($parser->statements[0]))
) {
$aliases = \PhpMyAdmin\SqlParser\Utils\Misc::getAliases($parser->statements[0], $db);
}
if (!empty($_REQUEST['aliases'])) {
$aliases = $export->mergeAliases($aliases, $_REQUEST['aliases']);
$_SESSION['tmpval']['aliases'] = $_REQUEST['aliases'];
if (!empty($_POST['aliases'])) {
$aliases = $export->mergeAliases($aliases, $_POST['aliases']);
$_SESSION['tmpval']['aliases'] = $_POST['aliases'];
}
/**
@ -466,7 +466,7 @@ do {
if (!isset($table_data) || !is_array($table_data)) {
$table_data = [];
}
if (!empty($_REQUEST['structure_or_data_forced'])) {
if (!empty($_POST['structure_or_data_forced'])) {
$table_structure = $tables;
$table_data = $tables;
}

View File

@ -18,14 +18,14 @@ require_once 'libraries/common.inc.php';
$template = new Template();
if (! isset($_REQUEST['field'])) {
if (! isset($_POST['field'])) {
Util::checkParameters(['field']);
}
// Get data if any posted
$gis_data = [];
if (Core::isValid($_REQUEST['gis_data'], 'array')) {
$gis_data = $_REQUEST['gis_data'];
if (Core::isValid($_POST['gis_data'], 'array')) {
$gis_data = $_POST['gis_data'];
}
$gis_types = [
@ -41,15 +41,15 @@ $gis_types = [
// Extract type from the initial call and make sure that it's a valid one.
// Extract from field's values if available, if not use the column type passed.
if (! isset($gis_data['gis_type'])) {
if (isset($_REQUEST['type']) && $_REQUEST['type'] != '') {
$gis_data['gis_type'] = mb_strtoupper($_REQUEST['type']);
if (isset($_POST['type']) && $_POST['type'] != '') {
$gis_data['gis_type'] = mb_strtoupper($_POST['type']);
}
if (isset($_REQUEST['value']) && trim($_REQUEST['value']) != '') {
$start = (substr($_REQUEST['value'], 0, 1) == "'") ? 1 : 0;
if (isset($_POST['value']) && trim($_POST['value']) != '') {
$start = (substr($_POST['value'], 0, 1) == "'") ? 1 : 0;
$gis_data['gis_type'] = mb_substr(
$_REQUEST['value'],
$_POST['value'],
$start,
mb_strpos($_REQUEST['value'], "(") - $start
mb_strpos($_POST['value'], "(") - $start
);
}
if ((! isset($gis_data['gis_type']))
@ -62,10 +62,10 @@ $geom_type = $gis_data['gis_type'];
// Generate parameters from value passed.
$gis_obj = GisFactory::factory($geom_type);
if (isset($_REQUEST['value'])) {
if (isset($_POST['value'])) {
$gis_data = array_merge(
$gis_data,
$gis_obj->generateParams($_REQUEST['value'])
$gis_obj->generateParams($_POST['value'])
);
}
@ -89,7 +89,7 @@ $open_layers = GisVisualization::getByData($data, $visualizationSettings)
->asOl();
// If the call is to update the WKT and visualization make an AJAX response
if (isset($_REQUEST['generate']) && $_REQUEST['generate'] == true) {
if (isset($_POST['generate']) && $_POST['generate'] == true) {
$extra_data = [
'result' => $result,
'visualization' => $visualization,
@ -111,8 +111,8 @@ if ($geom_type == 'GEOMETRYCOLLECTION') {
$templateOutput = $template->render('gis_data_editor_form', [
'pma_theme_image' => $GLOBALS['pmaThemeImage'],
'field' => $_REQUEST['field'],
'input_name' => $_REQUEST['input_name'],
'field' => $_POST['field'],
'input_name' => $_POST['input_name'],
'srid' => $srid,
'visualization' => $visualization,
'open_layers' => $open_layers,

View File

@ -32,12 +32,12 @@ require_once 'libraries/common.inc.php';
$import = new Import();
if (isset($_REQUEST['show_as_php'])) {
$GLOBALS['show_as_php'] = $_REQUEST['show_as_php'];
if (isset($_POST['show_as_php'])) {
$GLOBALS['show_as_php'] = $_POST['show_as_php'];
}
// If there is a request to 'Simulate DML'.
if (isset($_REQUEST['simulate_dml'])) {
if (isset($_POST['simulate_dml'])) {
$import->handleSimulateDmlRequest();
exit;
}
@ -47,7 +47,7 @@ $response = Response::getInstance();
$sql = new Sql();
// If it's a refresh console bookmarks request
if (isset($_REQUEST['console_bookmark_refresh'])) {
if (isset($_GET['console_bookmark_refresh'])) {
$response->addJSON(
'console_message_bookmark',
PhpMyAdmin\Console::getBookmarkContent()
@ -55,18 +55,18 @@ if (isset($_REQUEST['console_bookmark_refresh'])) {
exit;
}
// If it's a console bookmark add request
if (isset($_REQUEST['console_bookmark_add'])) {
if (isset($_REQUEST['label']) && isset($_REQUEST['db'])
&& isset($_REQUEST['bookmark_query']) && isset($_REQUEST['shared'])
if (isset($_POST['console_bookmark_add'])) {
if (isset($_POST['label']) && isset($_POST['db'])
&& isset($_POST['bookmark_query']) && isset($_POST['shared'])
) {
$cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']);
$bookmarkFields = [
'bkm_database' => $_REQUEST['db'],
'bkm_database' => $_POST['db'],
'bkm_user' => $cfgBookmark['user'],
'bkm_sql_query' => $_REQUEST['bookmark_query'],
'bkm_label' => $_REQUEST['label']
'bkm_sql_query' => $_POST['bookmark_query'],
'bkm_label' => $_POST['label']
];
$isShared = ($_REQUEST['shared'] == 'true' ? true : false);
$isShared = ($_POST['shared'] == 'true' ? true : false);
$bookmark = Bookmark::createBookmark(
$GLOBALS['dbi'],
$GLOBALS['cfg']['Server']['user'],
@ -128,11 +128,11 @@ $import_text = '';
// (eg. non import, but query box/window run)
if (! empty($sql_query)) {
// apply values for parameters
if (! empty($_REQUEST['parameterized'])
&& ! empty($_REQUEST['parameters'])
&& is_array($_REQUEST['parameters'])
if (! empty($_POST['parameterized'])
&& ! empty($_POST['parameters'])
&& is_array($_POST['parameters'])
) {
$parameters = $_REQUEST['parameters'];
$parameters = $_POST['parameters'];
foreach ($parameters as $parameter => $replacement) {
$quoted = preg_quote($parameter, '/');
// making sure that :param does not apply values to :param1
@ -157,7 +157,7 @@ if (! empty($sql_query)) {
$_SESSION['sql_from_query_box'] = true;
// If there is a request to ROLLBACK when finished.
if (isset($_REQUEST['rollback_query'])) {
if (isset($_POST['rollback_query'])) {
$import->handleRollbackRequest($import_text);
}
@ -195,7 +195,7 @@ if (! empty($sql_query)) {
$import_type = 'queryfile';
$format = 'sql';
unset($sql_file);
} elseif (! empty($_REQUEST['id_bookmark'])) {
} elseif (! empty($_POST['id_bookmark'])) {
// run bookmark
$import_type = 'query';
$format = 'sql';
@ -309,7 +309,7 @@ if (! empty($cfg['MemoryLimit'])) {
}
$timestamp = time();
if (isset($_REQUEST['allow_interrupt'])) {
if (isset($_POST['allow_interrupt'])) {
$maximum_time = ini_get('max_execution_time');
} else {
$maximum_time = 0;
@ -335,9 +335,9 @@ $result = false;
$msg = 'Sorry an unexpected error happened!';
// Bookmark Support: get a query back from bookmark if required
if (! empty($_REQUEST['id_bookmark'])) {
$id_bookmark = (int)$_REQUEST['id_bookmark'];
switch ($_REQUEST['action_bookmark']) {
if (! empty($_POST['id_bookmark'])) {
$id_bookmark = (int)$_POST['id_bookmark'];
switch ($_POST['action_bookmark']) {
case 0: // bookmarked query that have to be run
$bookmark = Bookmark::get(
$GLOBALS['dbi'],
@ -345,12 +345,12 @@ if (! empty($_REQUEST['id_bookmark'])) {
$db,
$id_bookmark,
'id',
isset($_REQUEST['action_bookmark_all'])
isset($_POST['action_bookmark_all'])
);
if (! empty($_REQUEST['bookmark_variable'])) {
if (! empty($_POST['bookmark_variable'])) {
$import_text = $bookmark->applyVariables(
$_REQUEST['bookmark_variable']
$_POST['bookmark_variable']
);
} else {
$import_text = $bookmark->getQuery();
@ -387,7 +387,7 @@ if (! empty($_REQUEST['id_bookmark'])) {
$response->setRequestStatus($message->isSuccess());
$response->addJSON('message', $message);
$response->addJSON('sql_query', $import_text);
$response->addJSON('action_bookmark', $_REQUEST['action_bookmark']);
$response->addJSON('action_bookmark', $_POST['action_bookmark']);
exit;
} else {
$run_query = false;
@ -408,7 +408,7 @@ if (! empty($_REQUEST['id_bookmark'])) {
);
$response->setRequestStatus($message->isSuccess());
$response->addJSON('message', $message);
$response->addJSON('action_bookmark', $_REQUEST['action_bookmark']);
$response->addJSON('action_bookmark', $_POST['action_bookmark']);
$response->addJSON('id_bookmark', $id_bookmark);
exit;
} else {
@ -580,11 +580,11 @@ if ($reset_charset) {
}
// Show correct message
if (! empty($id_bookmark) && $_REQUEST['action_bookmark'] == 2) {
if (! empty($id_bookmark) && $_POST['action_bookmark'] == 2) {
$message = PhpMyAdmin\Message::success(__('The bookmark has been deleted.'));
$display_query = $import_text;
$error = false; // unset error marker, it was used just to skip processing
} elseif (! empty($id_bookmark) && $_REQUEST['action_bookmark'] == 1) {
} elseif (! empty($id_bookmark) && $_POST['action_bookmark'] == 1) {
$message = PhpMyAdmin\Message::notice(__('Showing bookmark'));
} elseif ($bookmark_created) {
$special_message = '[br]' . sprintf(
@ -790,6 +790,6 @@ if ($go_sql) {
}
// If there is request for ROLLBACK in the end.
if (isset($_REQUEST['rollback_query'])) {
if (isset($_POST['rollback_query'])) {
$GLOBALS['dbi']->query('ROLLBACK');
}

View File

@ -624,7 +624,7 @@ if ($server > 0) {
);
}
$msg = Message::notice($msg_text);
$msg->addParamHtml('<a href="./chk_rel.php' . $common_url_query . '">');
$msg->addParamHtml('<a href="./chk_rel.php" data-post="' . $common_url_query . '">');
$msg->addParamHtml('</a>');
/* Show error if user has configured something, notice elsewhere */
if (!empty($cfg['Servers'][$server]['pmadb'])) {

View File

@ -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();

View File

@ -84,10 +84,9 @@ AJAX.registerOnload('db_tracking.js', function () {
$anchor.PMA_confirm(question, $anchor.attr('href'), function (url) {
PMA_ajaxShowMessage(PMA_messages.strDeletingTrackingData);
AJAX.source = $anchor;
var params = {
'ajax_page_request': true,
'ajax_request': true
};
var argSep = PMA_commonParams.get('arg_separator');
var params = getJSConfirmCommonParam(this, $anchor.getPostData());
params += argSep + 'ajax_page_request=1';
$.post(url, params, AJAX.responseHandler);
});
});

View File

@ -23,7 +23,7 @@ var ErrorReport = {
exception.name = ErrorReport._extractExceptionName(exception);
}
ErrorReport._last_exception = exception;
$.get('error_report.php', {
$.post('error_report.php', {
ajax_request: true,
server: PMA_commonParams.get('server'),
get_settings: true,
@ -111,7 +111,7 @@ var ErrorReport = {
}
});
}
}); // end $.get()
});
},
/**
* Shows the small notification that asks for user permission

View File

@ -3857,7 +3857,7 @@ function indexEditorDialog (url, title, callback_success, callback_failure) {
$(this).dialog('close');
};
var $msgbox = PMA_ajaxShowMessage();
$.get('tbl_indexes.php', url, function (data) {
$.post('tbl_indexes.php', url, function (data) {
if (typeof data !== 'undefined' && data.success === false) {
// in the case of an error, show the error message returned.
PMA_ajaxShowMessage(data.error, false);
@ -4607,8 +4607,9 @@ function PMA_createViewDialog ($this) {
var $msg = PMA_ajaxShowMessage();
var syntaxHighlighter = null;
var sep = PMA_commonParams.get('arg_separator');
params = $this.getPostData();
$.get($this.attr('href') + sep + 'ajax_request=1' + sep + 'ajax_dialog=1' + sep + params, function (data) {
var params = getJSConfirmCommonParam(this, $this.getPostData());
params += sep + 'ajax_dialog=1';
$.post($this.attr('href'), params, function (data) {
if (typeof data !== 'undefined' && data.success === true) {
PMA_ajaxRemoveMessage($msg);
var buttonOptions = {};

View File

@ -697,10 +697,7 @@ AJAX.registerOnload('indexes.js', function () {
title = PMA_messages.strAddIndex;
} else {
// Edit index
url = $(this).find('a').attr('href');
if (url.substring(0, 16) === 'tbl_indexes.php?') {
url = url.substring(16, url.length);
}
url = $(this).find('a').getPostData();
title = PMA_messages.strEditIndex;
}
url += PMA_commonParams.get('arg_separator') + 'ajax_request=true';

View File

@ -519,12 +519,13 @@ $(function () {
/** Hide navigation tree item */
$(document).on('click', 'a.hideNavItem.ajax', function (event) {
event.preventDefault();
var argSep = PMA_commonParams.get('arg_separator');
var params = $(this).getPostData();
params += argSep + 'ajax_request=true' + argSep + 'server=' + PMA_commonParams.get('server');
$.ajax({
type: 'POST',
data: {
server: PMA_commonParams.get('server'),
},
url: $(this).attr('href') + PMA_commonParams.get('arg_separator') + 'ajax_request=true',
data: params,
url: $(this).attr('href'),
success: function (data) {
if (typeof data !== 'undefined' && data.success === true) {
PMA_reloadNavigation();
@ -539,7 +540,10 @@ $(function () {
$(document).on('click', 'a.showUnhide.ajax', function (event) {
event.preventDefault();
var $msg = PMA_ajaxShowMessage();
$.get($(this).attr('href') + PMA_commonParams.get('arg_separator') + 'ajax_request=1', function (data) {
var argSep = PMA_commonParams.get('arg_separator');
var params = $(this).getPostData();
params += argSep + 'ajax_request=true';
$.post($(this).attr('href'), params, function (data) {
if (typeof data !== 'undefined' && data.success === true) {
PMA_ajaxRemoveMessage($msg);
var buttonOptions = {};
@ -572,12 +576,13 @@ $(function () {
var $hidden_table_count = $tr.parents('tbody').children().length;
var $hide_dialog_box = $tr.closest('div.ui-dialog');
var $msg = PMA_ajaxShowMessage();
var argSep = PMA_commonParams.get('arg_separator');
var params = $(this).getPostData();
params += argSep + 'ajax_request=true' + argSep + 'server=' + PMA_commonParams.get('server');
$.ajax({
type: 'POST',
data: {
server: PMA_commonParams.get('server'),
},
url: $(this).attr('href') + PMA_commonParams.get('arg_separator') + 'ajax_request=true',
data: params,
url: $(this).attr('href'),
success: function (data) {
PMA_ajaxRemoveMessage($msg);
if (typeof data !== 'undefined' && data.success === true) {

View File

@ -60,13 +60,14 @@ AJAX.registerOnload('server_databases.js', function () {
$(this).PMA_confirm(
question,
$form.prop('action') + '?' + $(this).serialize() +
argsep + 'drop_selected_dbs=1' + argsep + 'is_js_confirmed=1' + argsep + 'ajax_request=true',
argsep + 'drop_selected_dbs=1',
function (url) {
PMA_ajaxShowMessage(PMA_messages.strProcessingRequest, false);
var params = getJSConfirmCommonParam(this);
var parts = url.split('?');
var params = getJSConfirmCommonParam(this, parts[1]);
$.post(url, params, function (data) {
$.post(parts[0], params, function (data) {
if (typeof data !== 'undefined' && data.success === true) {
PMA_ajaxShowMessage(data.message);

View File

@ -686,7 +686,7 @@ AJAX.registerOnload('server_status_monitor.js', function () {
$.extend(vars, getvars);
}
$.get('server_status_monitor.php' + PMA_commonParams.get('common_query'), vars,
$.post('server_status_monitor.php' + PMA_commonParams.get('common_query'), vars,
function (data) {
var logVars;
if (typeof data !== 'undefined' && data.success === true) {
@ -1591,9 +1591,10 @@ AJAX.registerOnload('server_status_monitor.js', function () {
buttons: dlgBtns
});
logRequest = $.get('server_status_monitor.php' + PMA_commonParams.get('common_query'),
{ ajax_request: true,
logRequest = $.post(
'server_status_monitor.php' + PMA_commonParams.get('common_query'),
{
ajax_request: true,
log_data: 1,
type: opts.src,
time_start: Math.round(opts.start / 1000),

View File

@ -47,10 +47,12 @@ var processList = {
*/
killProcessHandler: function (event) {
event.preventDefault();
var url = $(this).attr('href');
var argSep = PMA_commonParams.get('arg_separator');
var params = $(this).getPostData();
params += argSep + 'ajax_request=1' + argSep + 'server=' + PMA_commonParams.get('server');
// Get row element of the process to be killed.
var $tr = $(this).closest('tr');
$.getJSON(url, function (data) {
$.post($(this).attr('href'), params, function (data) {
// Check if process was killed or not.
if (data.hasOwnProperty('success') && data.success) {
// remove the row of killed process.
@ -66,7 +68,7 @@ var processList = {
// Show process error message
PMA_ajaxShowMessage(data.error, false);
}
});
}, 'json');
},
/**
@ -86,7 +88,7 @@ var processList = {
if (processList.autoRefresh) {
var interval = parseInt(processList.refreshInterval, 10) * 1000;
var urlParams = processList.getUrlParams();
processList.refreshRequest = $.get(processList.refreshUrl,
processList.refreshRequest = $.post(processList.refreshUrl,
urlParams,
function (data) {
if (data.hasOwnProperty('success') && data.success) {

View File

@ -866,7 +866,10 @@ function browseForeignDialog ($this_a) {
var tableId = '#browse_foreign_table';
var filterId = '#input_foreign_filter';
var $dialog = null;
$.get($this_a.attr('href'), { 'ajax_request': true }, function (data) {
var argSep = PMA_commonParams.get('arg_separator');
var params = $this_a.getPostData();
params += argSep + 'ajax_request=true';
$.post($this_a.attr('href'), params, function (data) {
// Creates browse foreign value dialog
$dialog = $('<div>').append(data.message).dialog({
title: PMA_messages.strBrowseForeignValues,

View File

@ -72,7 +72,7 @@ function getDropdownValues ($dropdown) {
var $msgbox = PMA_ajaxShowMessage();
var $form = $dropdown.parents('form');
var argsep = PMA_commonParams.get('arg_separator');
var url = 'tbl_relation.php?getDropdownValues=true' + argsep + 'ajax_request=true' +
var params = 'getDropdownValues=true' + argsep + 'ajax_request=true' +
argsep + 'db=' + $form.find('input[name="db"]').val() +
argsep + 'table=' + $form.find('input[name="table"]').val() +
argsep + 'foreign=' + (foreign !== '') +
@ -82,11 +82,13 @@ function getDropdownValues ($dropdown) {
);
var $server = $form.find('input[name="server"]');
if ($server.length > 0) {
url += argsep + 'server=' + $form.find('input[name="server"]').val();
params += argsep + 'server=' + $form.find('input[name="server"]').val();
}
$.ajax({
url: url,
datatype: 'json',
type: 'POST',
url: 'tbl_relation.php',
data: params,
dataType: 'json',
success: function (data) {
PMA_ajaxRemoveMessage($msgbox);
if (typeof data !== 'undefined' && data.success) {

View File

@ -80,10 +80,9 @@ AJAX.registerOnload('tbl_tracking.js', function () {
$anchor.PMA_confirm(question, $anchor.attr('href'), function (url) {
PMA_ajaxShowMessage();
AJAX.source = $anchor;
var params = {
'ajax_page_request': true,
'ajax_request': true
};
var argSep = PMA_commonParams.get('arg_separator');
var params = getJSConfirmCommonParam(this, $anchor.getPostData());
params += argSep + 'ajax_page_request=1';
$.post(url, params, AJAX.responseHandler);
});
});
@ -98,10 +97,9 @@ AJAX.registerOnload('tbl_tracking.js', function () {
$anchor.PMA_confirm(question, $anchor.attr('href'), function (url) {
PMA_ajaxShowMessage();
AJAX.source = $anchor;
var params = {
'ajax_page_request': true,
'ajax_request': true
};
var argSep = PMA_commonParams.get('arg_separator');
var params = getJSConfirmCommonParam(this, $anchor.getPostData());
params += argSep + 'ajax_page_request=1';
$.post(url, params, AJAX.responseHandler);
});
});

View File

@ -186,12 +186,12 @@ class BrowseForeigners
. '<input type="hidden" name="fieldkey" value="'
. (isset($fieldkey) ? htmlspecialchars($fieldkey) : '') . '" />';
if (isset($_REQUEST['rownumber'])) {
if (isset($_POST['rownumber'])) {
$output .= '<input type="hidden" name="rownumber" value="'
. htmlspecialchars((string) $_REQUEST['rownumber']) . '" />';
. htmlspecialchars((string) $_POST['rownumber']) . '" />';
}
$filter_value = (isset($_REQUEST['foreign_filter'])
? htmlspecialchars($_REQUEST['foreign_filter'])
$filter_value = (isset($_POST['foreign_filter'])
? htmlspecialchars($_POST['foreign_filter'])
: '');
$output .= '<span class="formelement">'
. '<label for="input_foreign_filter">' . __('Search:') . '</label>'
@ -308,7 +308,7 @@ class BrowseForeigners
private function getHtmlForGotoPage(?array $foreignData): string
{
$gotopage = '';
isset($_REQUEST['pos']) ? $pos = $_REQUEST['pos'] : $pos = 0;
isset($_POST['pos']) ? $pos = $_POST['pos'] : $pos = 0;
if (!is_array($foreignData['disp_row'])) {
return $gotopage;
}
@ -346,7 +346,7 @@ class BrowseForeigners
if (isset($foreignShowAll) && $foreignShowAll == __('Show all')) {
return null;
}
isset($_REQUEST['pos']) ? $pos = $_REQUEST['pos'] : $pos = 0;
isset($_POST['pos']) ? $pos = $_POST['pos'] : $pos = 0;
return 'LIMIT ' . $pos . ', ' . $this->maxRows . ' ';
}
}

View File

@ -310,7 +310,7 @@ class CentralColumns
if (empty($cfgCentralColumns)) {
return $this->configErrorMessage();
}
$db = $_REQUEST['db'];
$db = $_POST['db'];
$pmadb = $cfgCentralColumns['db'];
$central_list_table = $cfgCentralColumns['table'];
$this->dbi->selectDb($db);
@ -350,7 +350,7 @@ class CentralColumns
}
} else {
if ($table === null) {
$table = $_REQUEST['table'];
$table = $_POST['table'];
}
foreach ($field_select as $column) {
$cols .= "'" . $this->dbi->escapeString($column) . "',";
@ -429,7 +429,7 @@ class CentralColumns
if (empty($cfgCentralColumns)) {
return $this->configErrorMessage();
}
$db = $_REQUEST['db'];
$db = $_POST['db'];
$pmadb = $cfgCentralColumns['db'];
$central_list_table = $cfgCentralColumns['table'];
$this->dbi->selectDb($db);

View File

@ -60,15 +60,15 @@ class ServerBinlogController extends Controller
include_once 'libraries/server_common.inc.php';
$url_params = [];
if (! isset($_REQUEST['log'])
|| ! array_key_exists($_REQUEST['log'], $this->binary_logs)
if (! isset($_POST['log'])
|| ! array_key_exists($_POST['log'], $this->binary_logs)
) {
$_REQUEST['log'] = '';
$_POST['log'] = '';
} else {
$url_params['log'] = $_REQUEST['log'];
$url_params['log'] = $_POST['log'];
}
if (!empty($_REQUEST['dontlimitchars'])) {
if (!empty($_POST['dontlimitchars'])) {
$url_params['dontlimitchars'] = 1;
}
@ -93,7 +93,7 @@ class ServerBinlogController extends Controller
return $this->template->render('server/binlog/log_selector', [
'url_params' => $url_params,
'binary_logs' => $this->binary_logs,
'log' => $_REQUEST['log'],
'log' => $_POST['log'],
]);
}
@ -109,16 +109,16 @@ class ServerBinlogController extends Controller
/**
* Need to find the real end of rows?
*/
if (! isset($_REQUEST['pos'])) {
if (! isset($_POST['pos'])) {
$pos = 0;
} else {
/* We need this to be a integer */
$pos = (int) $_REQUEST['pos'];
$pos = (int) $_POST['pos'];
}
$sql_query = 'SHOW BINLOG EVENTS';
if (! empty($_REQUEST['log'])) {
$sql_query .= ' IN \'' . $_REQUEST['log'] . '\'';
if (! empty($_POST['log'])) {
$sql_query .= ' IN \'' . $_POST['log'] . '\'';
}
$sql_query .= ' LIMIT ' . $pos . ', ' . intval($GLOBALS['cfg']['MaxRows']);
@ -137,7 +137,7 @@ class ServerBinlogController extends Controller
$num_rows = 0;
}
if (empty($_REQUEST['dontlimitchars'])) {
if (empty($_POST['dontlimitchars'])) {
$dontlimitchars = false;
} else {
$dontlimitchars = true;
@ -195,8 +195,8 @@ class ServerBinlogController extends Controller
$this_url_params['pos'] = $pos - $GLOBALS['cfg']['MaxRows'];
}
$html .= '<a href="server_binlog.php'
. Url::getCommon($this_url_params) . '"';
$html .= '<a href="server_binlog.php" data-post="'
. Url::getCommon($this_url_params, '') . '"';
if (Util::showIcons('TableNavigationLinksMode')) {
$html .= ' title="' . _pgettext('Previous page', 'Previous') . '">';
} else {
@ -218,7 +218,7 @@ class ServerBinlogController extends Controller
$tempTitle = __('Show Full Queries');
$tempImgMode = 'full';
}
$html .= '<a href="server_binlog.php' . Url::getCommon($this_url_params)
$html .= '<a href="server_binlog.php" data-post="' . Url::getCommon($this_url_params, '')
. '" title="' . $tempTitle . '">'
. '<img src="' . $GLOBALS['pmaThemeImage'] . 's_' . $tempImgMode
. 'text.png" alt="' . $tempTitle . '" /></a>';
@ -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 .= ' - <a href="server_binlog.php'
. Url::getCommon($this_url_params)
$html .= ' - <a href="server_binlog.php" data-post="'
. Url::getCommon($this_url_params, '')
. '"';
if (Util::showIcons('TableNavigationLinksMode')) {
$html .= ' title="' . _pgettext('Next page', 'Next') . '">';

View File

@ -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';

View File

@ -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]
);

View File

@ -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])

View File

@ -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,

View File

@ -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);
}

View File

@ -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]);
}
/**

View File

@ -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];

View File

@ -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 .= '<td class="center">';
@ -586,21 +586,21 @@ class Qbe
}
// If they have chosen all fields using the * selector,
// then sorting is not available, Fix for Bug #570698
if (isset($_REQUEST['criteriaSort'][$colInd])
&& isset($_REQUEST['criteriaColumn'][$colInd])
&& mb_substr($_REQUEST['criteriaColumn'][$colInd], -2) == '.*'
if (isset($_POST['criteriaSort'][$colInd])
&& isset($_POST['criteriaColumn'][$colInd])
&& mb_substr($_POST['criteriaColumn'][$colInd], -2) == '.*'
) {
$_REQUEST['criteriaSort'][$colInd] = '';
$_POST['criteriaSort'][$colInd] = '';
} //end if
$selected = '';
if (isset($_REQUEST['criteriaSort'][$colInd])) {
if (isset($_POST['criteriaSort'][$colInd])) {
$this->_formSorts[$new_column_count]
= $_REQUEST['criteriaSort'][$colInd];
= $_POST['criteriaSort'][$colInd];
if ($_REQUEST['criteriaSort'][$colInd] == 'ASC') {
if ($_POST['criteriaSort'][$colInd] == 'ASC') {
$selected = 'ASC';
} elseif ($_REQUEST['criteriaSort'][$colInd] == 'DESC') {
} elseif ($_POST['criteriaSort'][$colInd] == 'DESC') {
$selected = 'DESC';
}
} else {
@ -650,10 +650,10 @@ class Qbe
}
$sortOrder = null;
if (! empty($_REQUEST['criteriaSortOrder'][$colInd])) {
if (! empty($_POST['criteriaSortOrder'][$colInd])) {
$sortOrder
= $this->_formSortOrders[$new_column_count]
= $_REQUEST['criteriaSortOrder'][$colInd];
= $_POST['criteriaSortOrder'][$colInd];
}
$html_output .= $this->_getSortOrderSelectCell(
@ -695,10 +695,10 @@ class Qbe
) {
continue;
}
if (isset($_REQUEST['criteriaShow'][$column_index])) {
if (isset($_POST['criteriaShow'][$column_index])) {
$checked_options = ' checked="checked"';
$this->_formShows[$new_column_count]
= $_REQUEST['criteriaShow'][$column_index];
= $_POST['criteriaShow'][$column_index];
} else {
$checked_options = '';
}
@ -1014,8 +1014,8 @@ class Qbe
continue;
}
$or = 'Or' . $new_row_index;
if (! empty($_REQUEST[$or]) && isset($_REQUEST[$or][$column_index])) {
$tmp_or = $_REQUEST[$or][$column_index];
if (! empty($_POST[$or]) && isset($_POST[$or][$column_index])) {
$tmp_or = $_POST[$or][$column_index];
} else {
$tmp_or = '';
}
@ -1176,7 +1176,7 @@ class Qbe
$column_index < $this->_criteria_column_count;
$column_index++) {
if (! empty($this->_formColumns[$column_index])
&& ! empty($_REQUEST['Or' . $row_index][$column_index])
&& ! empty($_POST['Or' . $row_index][$column_index])
&& $column_index
) {
$qry_orwhere .= ' '
@ -1186,11 +1186,11 @@ class Qbe
. ' ';
}
if (! empty($this->_formColumns[$column_index])
&& ! empty($_REQUEST['Or' . $row_index][$column_index])
&& ! empty($_POST['Or' . $row_index][$column_index])
) {
$qry_orwhere .= '(' . $this->_formColumns[$column_index]
. ' '
. $_REQUEST['Or' . $row_index][$column_index]
. $_POST['Or' . $row_index][$column_index]
. ')';
$last_orwhere = $column_index;
$criteria_cnt++;
@ -1913,12 +1913,12 @@ class Qbe
{
// sets column count
$criteriaColumnCount = Core::ifSetOr(
$_REQUEST['criteriaColumnCount'],
$_POST['criteriaColumnCount'],
3,
'numeric'
);
$criteriaColumnAdd = Core::ifSetOr(
$_REQUEST['criteriaColumnAdd'],
$_POST['criteriaColumnAdd'],
0,
'numeric'
);
@ -1928,8 +1928,8 @@ class Qbe
);
// sets row count
$rows = Core::ifSetOr($_REQUEST['rows'], 0, 'numeric');
$criteriaRowAdd = Core::ifSetOr($_REQUEST['criteriaRowAdd'], 0, 'numeric');
$rows = Core::ifSetOr($_POST['rows'], 0, 'numeric');
$criteriaRowAdd = Core::ifSetOr($_POST['criteriaRowAdd'], 0, 'numeric');
$this->_criteria_row_count = min(
100,
max($rows + $criteriaRowAdd, 0)

View File

@ -125,49 +125,49 @@ class Search
{
$this->tablesNamesOnly = $this->dbi->getTables($this->db);
if (empty($_REQUEST['criteriaSearchType'])
|| ! is_string($_REQUEST['criteriaSearchType'])
if (empty($_POST['criteriaSearchType'])
|| ! is_string($_POST['criteriaSearchType'])
|| ! array_key_exists(
$_REQUEST['criteriaSearchType'],
$_POST['criteriaSearchType'],
$this->searchTypes
)
) {
$this->criteriaSearchType = 1;
unset($_REQUEST['submit_search']);
unset($_POST['submit_search']);
} else {
$this->criteriaSearchType = (int) $_REQUEST['criteriaSearchType'];
$this->criteriaSearchType = (int) $_POST['criteriaSearchType'];
$this->searchTypeDescription
= $this->searchTypes[$_REQUEST['criteriaSearchType']];
= $this->searchTypes[$_POST['criteriaSearchType']];
}
if (empty($_REQUEST['criteriaSearchString'])
|| ! is_string($_REQUEST['criteriaSearchString'])
if (empty($_POST['criteriaSearchString'])
|| ! is_string($_POST['criteriaSearchString'])
) {
$this->criteriaSearchString = '';
unset($_REQUEST['submit_search']);
unset($_POST['submit_search']);
} else {
$this->criteriaSearchString = $_REQUEST['criteriaSearchString'];
$this->criteriaSearchString = $_POST['criteriaSearchString'];
}
$this->criteriaTables = [];
if (empty($_REQUEST['criteriaTables'])
|| ! is_array($_REQUEST['criteriaTables'])
if (empty($_POST['criteriaTables'])
|| ! is_array($_POST['criteriaTables'])
) {
unset($_REQUEST['submit_search']);
unset($_POST['submit_search']);
} else {
$this->criteriaTables = array_intersect(
$_REQUEST['criteriaTables'],
$_POST['criteriaTables'],
$this->tablesNamesOnly
);
}
if (empty($_REQUEST['criteriaColumnName'])
|| ! is_string($_REQUEST['criteriaColumnName'])
if (empty($_POST['criteriaColumnName'])
|| ! is_string($_POST['criteriaColumnName'])
) {
unset($this->criteriaColumnName);
} else {
$this->criteriaColumnName = $this->dbi->escapeString(
$_REQUEST['criteriaColumnName']
$_POST['criteriaColumnName']
);
}
}

View File

@ -69,11 +69,11 @@ class Export
*/
public function getHtmlForSelectOptions($tmpSelect = '')
{
// Check if the selected databases are defined in $_GET
// Check if the selected databases are defined in $_POST
// (from clicking Back button on export.php)
if (isset($_GET['db_select'])) {
$_GET['db_select'] = urldecode($_GET['db_select']);
$_GET['db_select'] = explode(",", $_GET['db_select']);
if (isset($_POST['db_select'])) {
$_POST['db_select'] = urldecode($_POST['db_select']);
$_POST['db_select'] = explode(",", $_POST['db_select']);
}
$databases = [];
@ -82,8 +82,8 @@ class Export
continue;
}
$isSelected = false;
if (isset($_GET['db_select'])) {
if (in_array($currentDb, $_GET['db_select'])) {
if (isset($_POST['db_select'])) {
if (in_array($currentDb, $_POST['db_select'])) {
$isSelected = true;
}
} elseif (!empty($tmpSelect)) {
@ -128,14 +128,14 @@ class Export
global $cfg;
// If the export method was not set, the default is quick
if (isset($_GET['export_method'])) {
$cfg['Export']['method'] = $_GET['export_method'];
if (isset($_POST['export_method'])) {
$cfg['Export']['method'] = $_POST['export_method'];
} elseif (! isset($cfg['Export']['method'])) {
$cfg['Export']['method'] = 'quick';
}
if (empty($sqlQuery) && isset($_GET['sql_query'])) {
$sqlQuery = $_GET['sql_query'];
if (empty($sqlQuery) && isset($_POST['sql_query'])) {
$sqlQuery = $_POST['sql_query'];
}
return $this->template->render('display/export/hidden_inputs', [
@ -145,7 +145,7 @@ class Export
'export_method' => $cfg['Export']['method'],
'single_table' => $singleTable,
'sql_query' => $sqlQuery,
'template_id' => isset($_GET['template_id']) ? $_GET['template_id'] : '',
'template_id' => isset($_POST['template_id']) ? $_POST['template_id'] : '',
]);
}
@ -183,7 +183,7 @@ class Export
return $this->template->render('display/export/template_options', [
'templates' => $templates,
'selected_template' => !empty($_GET['template_id']) ? $_GET['template_id'] : null,
'selected_template' => !empty($_POST['template_id']) ? $_POST['template_id'] : null,
]);
}
@ -195,8 +195,8 @@ class Export
private function getHtmlForOptionsMethod()
{
global $cfg;
if (isset($_GET['quick_or_custom'])) {
$exportMethod = $_GET['quick_or_custom'];
if (isset($_POST['quick_or_custom'])) {
$exportMethod = $_POST['quick_or_custom'];
} else {
$exportMethod = $cfg['Export']['method'];
}
@ -271,9 +271,9 @@ class Export
$numberOfRows = $tableObject->countRecords();
return $this->template->render('display/export/options_rows', [
'allrows' => isset($_GET['allrows']) ? $_GET['allrows'] : null,
'limit_to' => isset($_GET['limit_to']) ? $_GET['limit_to'] : null,
'limit_from' => isset($_GET['limit_from']) ? $_GET['limit_from'] : null,
'allrows' => isset($_POST['allrows']) ? $_POST['allrows'] : null,
'limit_to' => isset($_POST['limit_to']) ? $_POST['limit_to'] : null,
'limit_from' => isset($_POST['limit_from']) ? $_POST['limit_from'] : null,
'unlim_num_rows' => $unlimNumRows,
'number_of_rows' => $numberOfRows,
]);
@ -364,8 +364,8 @@ class Export
);
$msg->addParamHtml('</a>');
if (isset($_GET['filename_template'])) {
$filenameTemplate = $_GET['filename_template'];
if (isset($_POST['filename_template'])) {
$filenameTemplate = $_POST['filename_template'];
} else {
if ($exportType == 'database') {
$filenameTemplate = $GLOBALS['PMA_Config']->getUserValue(
@ -415,8 +415,8 @@ class Export
private function getHtmlForOptionsOutputCompression()
{
global $cfg;
if (isset($_GET['compression'])) {
$selectedCompression = $_GET['compression'];
if (isset($_POST['compression'])) {
$selectedCompression = $_POST['compression'];
} elseif (isset($cfg['Export']['compression'])) {
$selectedCompression = $cfg['Export']['compression'];
} else {
@ -449,7 +449,7 @@ class Export
private function getHtmlForOptionsOutputRadio()
{
return $this->template->render('display/export/options_output_radio', [
'has_repopulate' => isset($_GET['repopulate']),
'has_repopulate' => isset($_POST['repopulate']),
'export_asfile' => $GLOBALS['cfg']['Export']['asfile'],
]);
}
@ -512,8 +512,8 @@ class Export
'export_type' => $exportType,
'is_checked_lock_tables' => $isCheckedLockTables,
'is_checked_asfile' => $isCheckedAsfile,
'repopulate' => isset($_GET['repopulate']),
'lock_tables' => isset($_GET['lock_tables']),
'repopulate' => isset($_POST['repopulate']),
'lock_tables' => isset($_POST['lock_tables']),
'save_dir' => isset($cfg['SaveDir']) ? $cfg['SaveDir'] : null,
'is_encoding_supported' => Encoding::isSupported(),
'options_output_save_dir' => $optionsOutputSaveDir,
@ -665,8 +665,8 @@ class Export
) {
$cfgRelation = $this->relation->getRelationsParam();
if (isset($_REQUEST['single_table'])) {
$GLOBALS['single_table'] = $_REQUEST['single_table'];
if (isset($_POST['single_table'])) {
$GLOBALS['single_table'] = $_POST['single_table'];
}
/* Scan for plugins */
@ -738,8 +738,8 @@ class Export
*/
public function handleTemplateActions(array $cfgRelation)
{
if (isset($_REQUEST['templateId'])) {
$id = $GLOBALS['dbi']->escapeString($_REQUEST['templateId']);
if (isset($_POST['templateId'])) {
$id = $GLOBALS['dbi']->escapeString($_POST['templateId']);
} else {
$id = '';
}
@ -748,16 +748,16 @@ class Export
. Util::backquote($cfgRelation['export_templates']);
$user = $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']);
switch ($_REQUEST['templateAction']) {
switch ($_POST['templateAction']) {
case 'create':
$query = "INSERT INTO " . $templateTable . "("
. " `username`, `export_type`,"
. " `template_name`, `template_data`"
. ") VALUES ("
. "'" . $user . "', "
. "'" . $GLOBALS['dbi']->escapeString($_REQUEST['exportType'])
. "', '" . $GLOBALS['dbi']->escapeString($_REQUEST['templateName'])
. "', '" . $GLOBALS['dbi']->escapeString($_REQUEST['templateData'])
. "'" . $GLOBALS['dbi']->escapeString($_POST['exportType'])
. "', '" . $GLOBALS['dbi']->escapeString($_POST['templateName'])
. "', '" . $GLOBALS['dbi']->escapeString($_POST['templateData'])
. "');";
break;
case 'load':
@ -766,7 +766,7 @@ class Export
break;
case 'update':
$query = "UPDATE " . $templateTable . " SET `template_data` = "
. "'" . $GLOBALS['dbi']->escapeString($_REQUEST['templateData']) . "'"
. "'" . $GLOBALS['dbi']->escapeString($_POST['templateData']) . "'"
. " WHERE `id` = " . $id . " AND `username` = '" . $user . "'";
break;
case 'delete':
@ -789,12 +789,12 @@ class Export
}
$response->setRequestStatus(true);
if ('create' == $_REQUEST['templateAction']) {
if ('create' == $_POST['templateAction']) {
$response->addJSON(
'data',
$this->getOptionsForTemplates($_REQUEST['exportType'])
$this->getOptionsForTemplates($_POST['exportType'])
);
} elseif ('load' == $_REQUEST['templateAction']) {
} elseif ('load' == $_POST['templateAction']) {
$data = null;
while ($row = $GLOBALS['dbi']->fetchAssoc(
$result,

View File

@ -3032,29 +3032,30 @@ class Results
$include_file = 'libraries/classes/Plugins/Transformations/' . $file;
if (@file_exists($include_file)) {
include_once $include_file;
$class_name = $this->transformations->getClassName($include_file);
// todo add $plugin_manager
$plugin_manager = null;
$transformation_plugin = new $class_name(
$plugin_manager
);
if (class_exists($class_name)) {
// todo add $plugin_manager
$plugin_manager = null;
$transformation_plugin = new $class_name(
$plugin_manager
);
$transform_options = $this->transformations->getOptions(
isset(
$mime_map[$orgFullColName]
$transform_options = $this->transformations->getOptions(
isset(
$mime_map[$orgFullColName]
['transformation_options']
)
? $mime_map[$orgFullColName]
['transformation_options']
)
? $mime_map[$orgFullColName]
['transformation_options']
: ''
);
: ''
);
$meta->mimetype = str_replace(
'_',
'/',
$mime_map[$orgFullColName]['mimetype']
);
$meta->mimetype = str_replace(
'_',
'/',
$mime_map[$orgFullColName]['mimetype']
);
}
} // end if file_exists
} // end if transformation is set
} // end if mime/transformation works.
@ -4168,13 +4169,13 @@ class Results
}
// as this is a form value, the type is always string so we cannot
// use Core::isValid($_REQUEST['session_max_rows'], 'integer')
if (Core::isValid($_REQUEST['session_max_rows'], 'numeric')) {
$query['max_rows'] = (int)$_REQUEST['session_max_rows'];
unset($_REQUEST['session_max_rows']);
} elseif ($_REQUEST['session_max_rows'] == self::ALL_ROWS) {
// use Core::isValid($_POST['session_max_rows'], 'integer')
if (Core::isValid($_POST['session_max_rows'], 'numeric')) {
$query['max_rows'] = (int)$_POST['session_max_rows'];
unset($_POST['session_max_rows']);
} elseif ($_POST['session_max_rows'] == self::ALL_ROWS) {
$query['max_rows'] = self::ALL_ROWS;
unset($_REQUEST['session_max_rows']);
unset($_POST['session_max_rows']);
} elseif (empty($query['max_rows'])) {
$query['max_rows'] = intval($GLOBALS['cfg']['MaxRows']);
}

View File

@ -103,10 +103,10 @@ class ErrorReport
];
if ($exceptionType == 'js') {
if (empty($_REQUEST['exception'])) {
if (empty($_POST['exception'])) {
return [];
}
$exception = $_REQUEST['exception'];
$exception = $_POST['exception'];
$exception["stack"] = $this->translateStacktrace($exception["stack"]);
list($uri, $scriptName) = $this->sanitizeUrl((string)$exception["url"]);
$exception["uri"] = $uri;
@ -115,10 +115,10 @@ class ErrorReport
$report["exception_type"] = 'js';
$report["exception"] = $exception;
$report["script_name"] = $scriptName;
$report["microhistory"] = $_REQUEST['microhistory'];
$report["microhistory"] = $_POST['microhistory'];
if (! empty($_REQUEST['description'])) {
$report['steps'] = $_REQUEST['description'];
if (! empty($_POST['description'])) {
$report['steps'] = $_POST['description'];
}
} elseif ($exceptionType == 'php') {
$errors = [];

View File

@ -342,9 +342,9 @@ class Export
. preg_replace('@[/\\\\]@', '_', $filename);
if (@file_exists($save_filename)
&& ((! $quick_export && empty($_REQUEST['onserver_overwrite']))
&& ((! $quick_export && empty($_POST['onserver_overwrite']))
|| ($quick_export
&& $_REQUEST['quick_export_onserver_overwrite'] != 'saveitover'))
&& $_POST['quick_export_onserver_overwrite'] != 'saveitover'))
) {
$message = Message::error(
__(
@ -474,45 +474,44 @@ class Export
$html = '<div>';
/**
* Displays a back button with all the $_REQUEST data in the URL
* Displays a back button with all the $_POST data in the URL
* (store in a variable to also display after the textarea)
*/
$back_button = '<p id="export_back_button">[ <a href="';
if ($export_type == 'server') {
$back_button .= 'server_export.php' . Url::getCommon();
$back_button .= 'server_export.php" data-post="' . Url::getCommon([], '');
} elseif ($export_type == 'database') {
$back_button .= 'db_export.php' . Url::getCommon(['db' => $db]);
$back_button .= 'db_export.php" data-post="' . Url::getCommon(['db' => $db], '');
} else {
$back_button .= 'tbl_export.php' . Url::getCommon(
[
'db' => $db, 'table' => $table
]
$back_button .= 'tbl_export.php" data-post="' . Url::getCommon(
['db' => $db, 'table' => $table],
''
);
}
// Convert the multiple select elements from an array to a string
if ($export_type == 'server' && isset($_REQUEST['db_select'])) {
$_REQUEST['db_select'] = implode(",", $_REQUEST['db_select']);
if ($export_type == 'server' && isset($_POST['db_select'])) {
$_POST['db_select'] = implode(",", $_POST['db_select']);
} elseif ($export_type == 'database') {
if (isset($_REQUEST['table_select'])) {
$_REQUEST['table_select'] = implode(",", $_REQUEST['table_select']);
if (isset($_POST['table_select'])) {
$_POST['table_select'] = implode(",", $_POST['table_select']);
}
if (isset($_REQUEST['table_structure'])) {
$_REQUEST['table_structure'] = implode(
if (isset($_POST['table_structure'])) {
$_POST['table_structure'] = implode(
",",
$_REQUEST['table_structure']
$_POST['table_structure']
);
} elseif (empty($_REQUEST['structure_or_data_forced'])) {
$_REQUEST['table_structure'] = '';
} elseif (empty($_POST['structure_or_data_forced'])) {
$_POST['table_structure'] = '';
}
if (isset($_REQUEST['table_data'])) {
$_REQUEST['table_data'] = implode(",", $_REQUEST['table_data']);
} elseif (empty($_REQUEST['structure_or_data_forced'])) {
$_REQUEST['table_data'] = '';
if (isset($_POST['table_data'])) {
$_POST['table_data'] = implode(",", $_POST['table_data']);
} elseif (empty($_POST['structure_or_data_forced'])) {
$_POST['table_data'] = '';
}
}
foreach ($_REQUEST as $name => $value) {
foreach ($_POST as $name => $value) {
if (!is_array($value)) {
$back_button .= '&amp;' . urlencode((string) $name) . '=' . urlencode((string) $value);
}

View File

@ -154,28 +154,28 @@ class Footer
'target' => $target
];
// needed for server privileges tabs
if (isset($_REQUEST['viewing_mode'])
&& in_array($_REQUEST['viewing_mode'], ['server', 'db', 'table'])
if (isset($_GET['viewing_mode'])
&& in_array($_GET['viewing_mode'], ['server', 'db', 'table'])
) {
$params['viewing_mode'] = $_REQUEST['viewing_mode'];
$params['viewing_mode'] = $_GET['viewing_mode'];
}
/*
* @todo coming from server_privileges.php, here $db is not set,
* add the following condition below when that is fixed
* && $_REQUEST['checkprivsdb'] == $db
* && $_GET['checkprivsdb'] == $db
*/
if (isset($_REQUEST['checkprivsdb'])
if (isset($_GET['checkprivsdb'])
) {
$params['checkprivsdb'] = $_REQUEST['checkprivsdb'];
$params['checkprivsdb'] = $_GET['checkprivsdb'];
}
/*
* @todo coming from server_privileges.php, here $table is not set,
* add the following condition below when that is fixed
* && $_REQUEST['checkprivstable'] == $table
*/
if (isset($_REQUEST['checkprivstable'])
if (isset($_GET['checkprivstable'])
) {
$params['checkprivstable'] = $_REQUEST['checkprivstable'];
$params['checkprivstable'] = $_GET['checkprivstable'];
}
if (isset($_REQUEST['single_table'])
&& in_array($_REQUEST['single_table'], [true, false])

View File

@ -297,7 +297,7 @@ class Import
$import_run_buffer = $this->runQueryPost($import_run_buffer, $sql, $full);
// In case of ROLLBACK, notify the user.
if (isset($_REQUEST['rollback_query'])) {
if (isset($_POST['rollback_query'])) {
$msg .= __('[ROLLBACK occurred.]');
}
}
@ -1365,7 +1365,7 @@ class Import
$response = Response::getInstance();
$error = false;
$error_msg = __('Only single-table UPDATE and DELETE queries can be simulated.');
$sql_delimiter = $_REQUEST['sql_delimiter'];
$sql_delimiter = $_POST['sql_delimiter'];
$sql_data = [];
$queries = explode($sql_delimiter, $GLOBALS['sql_query']);
foreach ($queries as $sql_query) {
@ -1587,7 +1587,7 @@ class Import
*/
public function handleRollbackRequest(string $sql_query): void
{
$sql_delimiter = $_REQUEST['sql_delimiter'];
$sql_delimiter = $_POST['sql_delimiter'];
$queries = explode($sql_delimiter, $sql_query);
$error = false;
$error_msg = __(
@ -1612,7 +1612,7 @@ class Import
}
if ($error) {
unset($_REQUEST['rollback_query']);
unset($_POST['rollback_query']);
$response = Response::getInstance();
$message = Message::rawError($error);
$response->addJSON('message', $message);

View File

@ -740,7 +740,7 @@ class Index
$r .= '" ' . $row_span . '>'
. ' <a class="';
$r .= 'ajax';
$r .= '" href="tbl_indexes.php' . Url::getCommon($this_params)
$r .= '" href="tbl_indexes.php" data-post="' . Url::getCommon($this_params, '')
. '">' . Util::getIcon('b_edit', __('Edit')) . '</a>'
. '</td>' . "\n";
$this_params = $GLOBALS['url_params'];

View File

@ -89,8 +89,8 @@ class InsertEdit
$_form_params['where_clause[' . $key_id . ']'] = trim($where_clause);
}
}
if (isset($_REQUEST['clause_is_unique'])) {
$_form_params['clause_is_unique'] = $_REQUEST['clause_is_unique'];
if (isset($_POST['clause_is_unique'])) {
$_form_params['clause_is_unique'] = $_POST['clause_is_unique'];
}
return $_form_params;
}
@ -290,13 +290,13 @@ class InsertEdit
$this_url_params = array_merge($url_params, $params);
if (! $is_show) {
return ' : <a href="tbl_change.php'
. Url::getCommon($this_url_params) . '">'
return ' : <a href="tbl_change.php" data-post="'
. Url::getCommon($this_url_params, '') . '">'
. $this->showTypeOrFunctionLabel($which)
. '</a>';
}
return '<th><a href="tbl_change.php'
. Url::getCommon($this_url_params)
return '<th><a href="tbl_change.php" data-post="'
. Url::getCommon($this_url_params, '')
. '" title="' . __('Hide') . '">'
. $this->showTypeOrFunctionLabel($which)
. '</a></th>';
@ -860,7 +860,7 @@ class InsertEdit
. 'id="field_' . $idindex . '_3" '
. 'value="' . htmlspecialchars($data) . '" />';
$html_output .= '<a class="ajax browse_foreign" href="browse_foreigners.php'
$html_output .= '<a class="ajax browse_foreign" href="browse_foreigners.php" data-post="'
. Url::getCommon(
[
'db' => $db,
@ -868,7 +868,8 @@ class InsertEdit
'field' => $column['Field'],
'rownumber' => $rownumber,
'data' => $data
]
],
''
) . '">'
. str_replace("'", "\'", $titles['Browse']) . '</a>';
return $html_output;
@ -1137,7 +1138,7 @@ class InsertEdit
$html_output .= '<option value="' . $enum_value['html'] . '"';
if ($data == $enum_value['plain']
|| ($data == ''
&& (! isset($_REQUEST['where_clause']) || $column['Null'] != 'YES')
&& (! isset($_POST['where_clause']) || $column['Null'] != 'YES')
&& isset($column['Default'])
&& $enum_value['plain'] == $column['Default'])
) {
@ -1193,7 +1194,7 @@ class InsertEdit
. ' ' . $onChangeClause;
if ($data == $enum_value['plain']
|| ($data == ''
&& (! isset($_REQUEST['where_clause']) || $column['Null'] != 'YES')
&& (! isset($_POST['where_clause']) || $column['Null'] != 'YES')
&& isset($column['Default'])
&& $enum_value['plain'] == $column['Default'])
) {
@ -1755,7 +1756,7 @@ class InsertEdit
'err_url' => $err_url,
'goto' => $GLOBALS['goto'],
'sql_query' => isset($_POST['sql_query']) ? $_POST['sql_query'] : null,
'has_where_clause' => isset($_REQUEST['where_clause']),
'has_where_clause' => isset($_POST['where_clause']),
'insert_rows_default' => $GLOBALS['cfg']['InsertRows'],
]);
}
@ -2037,8 +2038,8 @@ class InsertEdit
//when copying row, it is useful to empty auto-increment column
// to prevent duplicate key error
if (isset($_REQUEST['default_action'])
&& $_REQUEST['default_action'] === 'insert'
if (isset($_POST['default_action'])
&& $_POST['default_action'] === 'insert'
) {
if ($column['Key'] === 'PRI'
&& mb_strpos($column['Extra'], 'auto_increment') !== false
@ -2117,29 +2118,29 @@ class InsertEdit
*/
public function getParamsForUpdateOrInsert()
{
if (isset($_REQUEST['where_clause'])) {
if (isset($_POST['where_clause'])) {
// we were editing something => use the WHERE clause
$loop_array = is_array($_REQUEST['where_clause'])
? $_REQUEST['where_clause']
: [$_REQUEST['where_clause']];
$loop_array = is_array($_POST['where_clause'])
? $_POST['where_clause']
: [$_POST['where_clause']];
$using_key = true;
$is_insert = isset($_REQUEST['submit_type'])
&& ($_REQUEST['submit_type'] == 'insert'
|| $_REQUEST['submit_type'] == 'showinsert'
|| $_REQUEST['submit_type'] == 'insertignore');
$is_insert = isset($_POST['submit_type'])
&& ($_POST['submit_type'] == 'insert'
|| $_POST['submit_type'] == 'showinsert'
|| $_POST['submit_type'] == 'insertignore');
} else {
// new row => use indexes
$loop_array = [];
if (! empty($_REQUEST['fields'])) {
foreach ($_REQUEST['fields']['multi_edit'] as $key => $dummy) {
if (! empty($_POST['fields'])) {
foreach ($_POST['fields']['multi_edit'] as $key => $dummy) {
$loop_array[] = $key;
}
}
$using_key = false;
$is_insert = true;
}
$is_insertignore = isset($_REQUEST['submit_type'])
&& $_REQUEST['submit_type'] == 'insertignore';
$is_insertignore = isset($_POST['submit_type'])
&& $_POST['submit_type'] == 'insertignore';
return [$loop_array, $using_key, $is_insert, $is_insertignore];
}
@ -2151,11 +2152,11 @@ class InsertEdit
*/
public function isInsertRow()
{
if (isset($_REQUEST['insert_rows'])
&& is_numeric($_REQUEST['insert_rows'])
&& $_REQUEST['insert_rows'] != $GLOBALS['cfg']['InsertRows']
if (isset($_POST['insert_rows'])
&& is_numeric($_POST['insert_rows'])
&& $_POST['insert_rows'] != $GLOBALS['cfg']['InsertRows']
) {
$GLOBALS['cfg']['InsertRows'] = $_REQUEST['insert_rows'];
$GLOBALS['cfg']['InsertRows'] = $_POST['insert_rows'];
$response = Response::getInstance();
$header = $response->getHeader();
$scripts = $header->getScripts();
@ -2215,8 +2216,8 @@ class InsertEdit
public function getGotoInclude($goto_include)
{
$valid_options = ['new_insert', 'same_insert', 'edit_next'];
if (isset($_REQUEST['after_insert'])
&& in_array($_REQUEST['after_insert'], $valid_options)
if (isset($_POST['after_insert'])
&& in_array($_POST['after_insert'], $valid_options)
) {
$goto_include = 'tbl_change.php';
} elseif (! empty($GLOBALS['goto'])) {
@ -2250,8 +2251,8 @@ class InsertEdit
*/
public function getErrorUrl(array $url_params)
{
if (isset($_REQUEST['err_url'])) {
return $_REQUEST['err_url'];
if (isset($_POST['err_url'])) {
return $_POST['err_url'];
}
return 'tbl_change.php' . Url::getCommon($url_params);
@ -2260,7 +2261,7 @@ class InsertEdit
/**
* Builds the sql query
*
* @param boolean $is_insertignore $_REQUEST['submit_type'] == 'insertignore'
* @param boolean $is_insertignore $_POST['submit_type'] == 'insertignore'
* @param array $query_fields column names array
* @param array $value_sets array of query values
*
@ -2310,7 +2311,7 @@ class InsertEdit
$error_messages = [];
foreach ($query as $single_query) {
if ($_REQUEST['submit_type'] == 'showinsert') {
if ($_POST['submit_type'] == 'showinsert') {
$last_messages[] = Message::notice(__('Showing SQL query'));
continue;
}
@ -2496,11 +2497,10 @@ class InsertEdit
) {
$include_file = 'libraries/classes/Plugins/Transformations/' . $file;
if (is_file($include_file)) {
include_once $include_file;
$_url_params = [
'db' => $db,
'table' => $table,
'where_clause' => $_REQUEST['where_clause'],
'where_clause' => $_POST['where_clause'],
'transform_key' => $column_name
];
$transform_options = $this->transformations->getOptions(
@ -2510,19 +2510,21 @@ class InsertEdit
);
$transform_options['wrapper_link'] = Url::getCommon($_url_params);
$class_name = $this->transformations->getClassName($include_file);
/** @var TransformationsPlugin $transformation_plugin */
$transformation_plugin = new $class_name();
if (class_exists($class_name)) {
/** @var TransformationsPlugin $transformation_plugin */
$transformation_plugin = new $class_name();
foreach ($edited_values as $cell_index => $curr_cell_edited_values) {
if (isset($curr_cell_edited_values[$column_name])) {
$edited_values[$cell_index][$column_name]
= $extra_data['transformations'][$cell_index]
= $transformation_plugin->applyTransformation(
$curr_cell_edited_values[$column_name],
$transform_options
);
}
} // end of loop for each transformation cell
foreach ($edited_values as $cell_index => $curr_cell_edited_values) {
if (isset($curr_cell_edited_values[$column_name])) {
$edited_values[$cell_index][$column_name]
= $extra_data['transformations'][$cell_index]
= $transformation_plugin->applyTransformation(
$curr_cell_edited_values[$column_name],
$transform_options
);
}
} // end of loop for each transformation cell
}
}
return $extra_data;
}
@ -2736,10 +2738,10 @@ class InsertEdit
$current_value = "''";
}
} elseif ($type == 'set') {
if (! empty($_REQUEST['fields']['multi_edit'][$rownumber][$key])) {
if (! empty($_POST['fields']['multi_edit'][$rownumber][$key])) {
$current_value = implode(
',',
$_REQUEST['fields']['multi_edit'][$rownumber][$key]
$_POST['fields']['multi_edit'][$rownumber][$key]
);
$current_value = "'"
. $this->dbi->escapeString($current_value) . "'";
@ -2820,7 +2822,7 @@ class InsertEdit
. Util::backquote($column_name)
. ' FROM ' . Util::backquote($db) . '.'
. Util::backquote($table)
. ' WHERE ' . $_REQUEST['where_clause'][0];
. ' WHERE ' . $_POST['where_clause'][0];
$result = $this->dbi->tryQuery($sql_for_real_value);
$fields_meta = $this->dbi->getFieldsMeta($result);
@ -2866,23 +2868,23 @@ class InsertEdit
*/
public function determineInsertOrEdit($where_clause, $db, $table)
{
if (isset($_REQUEST['where_clause'])) {
$where_clause = $_REQUEST['where_clause'];
if (isset($_POST['where_clause'])) {
$where_clause = $_POST['where_clause'];
}
if (isset($_SESSION['edit_next'])) {
$where_clause = $_SESSION['edit_next'];
unset($_SESSION['edit_next']);
$after_insert = 'edit_next';
}
if (isset($_REQUEST['ShowFunctionFields'])) {
$GLOBALS['cfg']['ShowFunctionFields'] = $_REQUEST['ShowFunctionFields'];
if (isset($_POST['ShowFunctionFields'])) {
$GLOBALS['cfg']['ShowFunctionFields'] = $_POST['ShowFunctionFields'];
}
if (isset($_REQUEST['ShowFieldTypesInDataEditView'])) {
if (isset($_POST['ShowFieldTypesInDataEditView'])) {
$GLOBALS['cfg']['ShowFieldTypesInDataEditView']
= $_REQUEST['ShowFieldTypesInDataEditView'];
= $_POST['ShowFieldTypesInDataEditView'];
}
if (isset($_REQUEST['after_insert'])) {
$after_insert = $_REQUEST['after_insert'];
if (isset($_POST['after_insert'])) {
$after_insert = $_POST['after_insert'];
}
if (isset($where_clause)) {
@ -2907,8 +2909,8 @@ class InsertEdit
// Copying a row - fetched data will be inserted as a new row,
// therefore the where clause is needless.
if (isset($_REQUEST['default_action'])
&& $_REQUEST['default_action'] === 'insert'
if (isset($_POST['default_action'])
&& $_POST['default_action'] === 'insert'
) {
$where_clause = $where_clauses = null;
}
@ -3285,42 +3287,43 @@ class InsertEdit
$file = $column_mime['input_transformation'];
$include_file = 'libraries/classes/Plugins/Transformations/' . $file;
if (is_file($include_file)) {
include_once $include_file;
$class_name = $this->transformations->getClassName($include_file);
$transformation_plugin = new $class_name();
$transformation_options = $this->transformations->getOptions(
$column_mime['input_transformation_options']
);
$_url_params = [
'db' => $db,
'table' => $table,
'transform_key' => $column['Field'],
'where_clause' => $where_clause
];
$transformation_options['wrapper_link']
= Url::getCommon($_url_params);
$current_value = '';
if (isset($current_row[$column['Field']])) {
$current_value = $current_row[$column['Field']];
}
if (method_exists($transformation_plugin, 'getInputHtml')) {
$transformed_html = $transformation_plugin->getInputHtml(
$column,
$row_id,
$column_name_appendix,
$transformation_options,
$current_value,
$text_dir,
$tabindex,
$tabindex_for_value,
$idindex
);
}
if (method_exists($transformation_plugin, 'getScripts')) {
$GLOBALS['plugin_scripts'] = array_merge(
$GLOBALS['plugin_scripts'],
$transformation_plugin->getScripts()
if (class_exists($class_name)) {
$transformation_plugin = new $class_name();
$transformation_options = $this->transformations->getOptions(
$column_mime['input_transformation_options']
);
$_url_params = [
'db' => $db,
'table' => $table,
'transform_key' => $column['Field'],
'where_clause' => $where_clause
];
$transformation_options['wrapper_link']
= Url::getCommon($_url_params);
$current_value = '';
if (isset($current_row[$column['Field']])) {
$current_value = $current_row[$column['Field']];
}
if (method_exists($transformation_plugin, 'getInputHtml')) {
$transformed_html = $transformation_plugin->getInputHtml(
$column,
$row_id,
$column_name_appendix,
$transformation_options,
$current_value,
$text_dir,
$tabindex,
$tabindex_for_value,
$idindex
);
}
if (method_exists($transformation_plugin, 'getScripts')) {
$GLOBALS['plugin_scripts'] = array_merge(
$GLOBALS['plugin_scripts'],
$transformation_plugin->getScripts()
);
}
}
}
}

View File

@ -53,8 +53,8 @@ class Navigation
}
$tree = new NavigationTree();
if (! $response->isAjax()
|| ! empty($_REQUEST['full'])
|| ! empty($_REQUEST['reload'])
|| ! empty($_POST['full'])
|| ! empty($_POST['reload'])
) {
if ($GLOBALS['cfg']['ShowDatabasesNavigationAsTree']) {
// provide database tree in navigation
@ -240,8 +240,8 @@ class Navigation
$html .= '<tr>';
$html .= '<td>' . htmlspecialchars($hiddenItem) . '</td>';
$html .= '<td style="width:80px"><a href="navigation.php'
. Url::getCommon($params) . '"'
$html .= '<td style="width:80px"><a href="navigation.php" data-post="'
. Url::getCommon($params, '') . '"'
. ' class="unhideNavItem ajax">'
. Util::getIcon('show', __('Unhide'))
. '</a></td>';

View File

@ -95,8 +95,10 @@ class NavigationTree
public function __construct()
{
// Save the position at which we are in the database list
if (isset($_REQUEST['pos'])) {
$this->_pos = (int)$_REQUEST['pos'];
if (isset($_POST['pos'])) {
$this->_pos = (int) $_POST['pos'];
} elseif (isset($_GET['pos'])) {
$this->_pos = (int) $_GET['pos'];
}
if (!isset($this->_pos)) {
$this->_pos = $this->_getNavigationDbPos();
@ -111,19 +113,19 @@ class NavigationTree
$this->_pos3_value[0] = $_REQUEST['pos3_value'];
}
} else {
if (isset($_REQUEST['n0_aPath'])) {
if (isset($_POST['n0_aPath'])) {
$count = 0;
while (isset($_REQUEST['n' . $count . '_aPath'])) {
while (isset($_POST['n' . $count . '_aPath'])) {
$this->_aPath[$count] = $this->_parsePath(
$_REQUEST['n' . $count . '_aPath']
$_POST['n' . $count . '_aPath']
);
$index = 'n' . $count . '_pos2_';
$this->_pos2_name[$count] = $_REQUEST[$index . 'name'];
$this->_pos2_value[$count] = $_REQUEST[$index . 'value'];
$this->_pos2_name[$count] = $_POST[$index . 'name'];
$this->_pos2_value[$count] = $_POST[$index . 'value'];
$index = 'n' . $count . '_pos3_';
if (isset($_REQUEST[$index])) {
$this->_pos3_name[$count] = $_REQUEST[$index . 'name'];
$this->_pos3_value[$count] = $_REQUEST[$index . 'value'];
if (isset($_POST[$index])) {
$this->_pos3_name[$count] = $_POST[$index . 'name'];
$this->_pos3_value[$count] = $_POST[$index . 'value'];
}
$count++;
}
@ -132,11 +134,11 @@ class NavigationTree
if (isset($_REQUEST['vPath'])) {
$this->_vPath[0] = $this->_parsePath($_REQUEST['vPath']);
} else {
if (isset($_REQUEST['n0_vPath'])) {
if (isset($_POST['n0_vPath'])) {
$count = 0;
while (isset($_REQUEST['n' . $count . '_vPath'])) {
while (isset($_POST['n' . $count . '_vPath'])) {
$this->_vPath[$count] = $this->_parsePath(
$_REQUEST['n' . $count . '_vPath']
$_POST['n' . $count . '_vPath']
);
$count++;
}
@ -763,7 +765,7 @@ class NavigationTree
}
$groups[$key] = new Node(
$key,
htmlspecialchars($key),
Node::CONTAINER,
true
);

View File

@ -679,8 +679,8 @@ class NodeDatabase extends Node
'dbName' => $this->real_name,
];
$ret = '<span class="dbItemControls">'
. '<a href="navigation.php'
. Url::getCommon($params) . '"'
. '<a href="navigation.php" data-post="'
. Url::getCommon($params, '') . '"'
. ' class="showUnhide ajax">'
. Util::getImage(
'show',

View File

@ -50,8 +50,8 @@ abstract class NodeDatabaseChild extends Node
];
$ret = '<span class="navItemControls">'
. '<a href="navigation.php'
. Url::getCommon($params) . '"'
. '<a href="navigation.php" data-post="'
. Url::getCommon($params, '') . '"'
. ' class="hideNavItem ajax">'
. Util::getImage('hide', __('Hide'))
. '</a></span>';

View File

@ -159,7 +159,7 @@ class Normalization
'fields_meta' => null,
'mimework' => $cfgRelation['mimework'],
'content_cells' => $contentCells,
'change_column' => $_REQUEST['change_column'],
'change_column' => $_POST['change_column'],
'is_virtual_columns_supported' => Util::isVirtualColumnsSupported(),
'browse_mime' => $GLOBALS['cfg']['BrowseMIME'],
'server_type' => Util::getServerType(),

View File

@ -76,20 +76,21 @@ class Operations
/**
* Get HTML output for rename database
*
* @param string $db database name
* @param string $db database name
* @param string $db_collation dataset collation
*
* @return string
*/
public function getHtmlForRenameDatabase($db)
public function getHtmlForRenameDatabase($db, $db_collation)
{
$html_output = '<div>'
. '<form id="rename_db_form" '
. 'class="ajax" '
. 'method="post" action="db_operations.php" '
. 'onsubmit="return emptyCheckTheField(this, \'newname\')">';
if (isset($_REQUEST['db_collation'])) {
if (!is_null($db_collation)) {
$html_output .= '<input type="hidden" name="db_collation" '
. 'value="' . $_REQUEST['db_collation']
. 'value="' . $db_collation
. '" />' . "\n";
}
$html_output .= '<input type="hidden" name="what" value="data" />'
@ -185,11 +186,12 @@ class Operations
/**
* Get HTML snippet for copy database
*
* @param string $db database name
* @param string $db database name
* @param string $db_collation dataset collation
*
* @return string
*/
public function getHtmlForCopyDatabase($db)
public function getHtmlForCopyDatabase($db, $db_collation)
{
$drop_clause = 'DROP TABLE / DROP VIEW';
$choices = [
@ -206,9 +208,9 @@ class Operations
. 'method="post" action="db_operations.php" '
. 'onsubmit="return emptyCheckTheField(this, \'newname\')">';
if (isset($_REQUEST['db_collation'])) {
if (!is_null($db_collation)) {
$html_output .= '<input type="hidden" name="db_collation" '
. 'value="' . $_REQUEST['db_collation'] . '" />' . "\n";
. 'value="' . $db_collation . '" />' . "\n";
}
$html_output .= '<input type="hidden" name="db_copy" value="true" />' . "\n"
. Url::getHiddenInputs($db);
@ -285,19 +287,19 @@ class Operations
/**
* Get HTML snippet for change database charset
*
* @param string $db database name
* @param string $table table name
* @param string $db database name
* @param string $db_collation dataset collation
*
* @return string
*/
public function getHtmlForChangeDatabaseCharset($db, $table)
public function getHtmlForChangeDatabaseCharset($db, $db_collation)
{
$html_output = '<div>'
. '<form id="change_db_charset_form" ';
$html_output .= 'class="ajax" ';
$html_output .= 'method="post" action="db_operations.php">';
$html_output .= Url::getHiddenInputs($db, $table);
$html_output .= Url::getHiddenInputs($db);
$html_output .= '<fieldset>' . "\n"
. ' <legend>';
@ -312,7 +314,7 @@ class Operations
$GLOBALS['cfg']['Server']['DisableIS'],
'db_collation',
'select_db_collation',
isset($_REQUEST['db_collation']) ? $_REQUEST['db_collation'] : '',
!is_null($db_collation) ? $db_collation : '',
false
)
. '<br />'
@ -362,7 +364,7 @@ class Operations
if ($tmp_query !== null) {
// collect for later display
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
$this->dbi->selectDb($_REQUEST['newname']);
$this->dbi->selectDb($_POST['newname']);
$this->dbi->query($tmp_query);
}
}
@ -380,7 +382,7 @@ class Operations
if ($tmp_query !== null) {
// collect for later display
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
$this->dbi->selectDb($_REQUEST['newname']);
$this->dbi->selectDb($_POST['newname']);
$this->dbi->query($tmp_query);
}
}
@ -395,10 +397,10 @@ class Operations
public function createDbBeforeCopy()
{
$local_query = 'CREATE DATABASE IF NOT EXISTS '
. Util::backquote($_REQUEST['newname']);
if (isset($_REQUEST['db_collation'])) {
. Util::backquote($_POST['newname']);
if (isset($_POST['db_collation'])) {
$local_query .= ' DEFAULT'
. Util::getCharsetQueryPart($_REQUEST['db_collation']);
. Util::getCharsetQueryPart($_POST['db_collation']);
}
$local_query .= ';';
$GLOBALS['sql_query'] .= $local_query;
@ -441,12 +443,12 @@ class Operations
// the real views are created after the tables
if ($this->dbi->getTable($db, (string)$each_table)->isView()) {
// If view exists, and 'add drop view' is selected: Drop it!
if ($_REQUEST['what'] != 'nocopy'
&& isset($_REQUEST['drop_if_exists'])
&& $_REQUEST['drop_if_exists'] == 'true'
if ($_POST['what'] != 'nocopy'
&& isset($_POST['drop_if_exists'])
&& $_POST['drop_if_exists'] == 'true'
) {
$drop_query = 'DROP VIEW IF EXISTS '
. Util::backquote($_REQUEST['newname']) . '.'
. Util::backquote($_POST['newname']) . '.'
. Util::backquote($each_table);
$this->dbi->query($drop_query);
@ -460,7 +462,7 @@ class Operations
$each_table,
"\n"
);
$this->dbi->selectDb($_REQUEST['newname']);
$this->dbi->selectDb($_POST['newname']);
$this->dbi->query($sql_view_standin);
$GLOBALS['sql_query'] .= "\n" . $sql_view_standin;
}
@ -487,7 +489,7 @@ class Operations
}
// value of $what for this table only
$this_what = $_REQUEST['what'];
$this_what = $_POST['what'];
// do not copy the data from a Merge table
// note: on the calling FORM, 'data' means 'structure and data'
@ -509,7 +511,7 @@ class Operations
if (! Table::moveCopy(
$db,
$each_table,
$_REQUEST['newname'],
$_POST['newname'],
$each_table,
(isset($this_what) ? $this_what : 'data'),
$move,
@ -520,7 +522,7 @@ class Operations
}
// apply the triggers to the destination db+table
if ($triggers) {
$this->dbi->selectDb($_REQUEST['newname']);
$this->dbi->selectDb($_POST['newname']);
foreach ($triggers as $trigger) {
$this->dbi->query($trigger['create']);
$GLOBALS['sql_query'] .= "\n" . $trigger['create'] . ';';
@ -528,7 +530,7 @@ class Operations
}
// this does not apply to a rename operation
if (isset($_REQUEST['add_constraints'])
if (isset($_POST['add_constraints'])
&& ! empty($GLOBALS['sql_constraints_query'])
) {
$sqlContraints[] = $GLOBALS['sql_constraints_query'];
@ -562,7 +564,7 @@ class Operations
$tmp_query = $this->dbi->getDefinition($db, 'EVENT', $event_name);
// collect for later display
$GLOBALS['sql_query'] .= "\n" . $tmp_query;
$this->dbi->selectDb($_REQUEST['newname']);
$this->dbi->selectDb($_POST['newname']);
$this->dbi->query($tmp_query);
}
}
@ -581,17 +583,17 @@ class Operations
{
// temporarily force to add DROP IF EXIST to CREATE VIEW query,
// to remove stand-in VIEW that was created earlier
// ( $_REQUEST['drop_if_exists'] is used in moveCopy() )
if (isset($_REQUEST['drop_if_exists'])) {
$temp_drop_if_exists = $_REQUEST['drop_if_exists'];
// ( $_POST['drop_if_exists'] is used in moveCopy() )
if (isset($_POST['drop_if_exists'])) {
$temp_drop_if_exists = $_POST['drop_if_exists'];
}
$_REQUEST['drop_if_exists'] = 'true';
$_POST['drop_if_exists'] = 'true';
foreach ($views as $view) {
$copying_succeeded = Table::moveCopy(
$db,
$view,
$_REQUEST['newname'],
$_POST['newname'],
$view,
'structure',
$move,
@ -602,11 +604,11 @@ class Operations
break;
}
}
unset($_REQUEST['drop_if_exists']);
unset($_POST['drop_if_exists']);
if (isset($temp_drop_if_exists)) {
// restore previous value
$_REQUEST['drop_if_exists'] = $temp_drop_if_exists;
$_POST['drop_if_exists'] = $temp_drop_if_exists;
}
}
@ -774,7 +776,7 @@ class Operations
*/
public function createAllAccumulatedConstraints(array $sqlConstratints)
{
$this->dbi->selectDb($_REQUEST['newname']);
$this->dbi->selectDb($_POST['newname']);
foreach ($sqlConstratints as $one_query) {
$this->dbi->query($one_query);
// and prepare to display them
@ -792,10 +794,10 @@ class Operations
*/
public function duplicateBookmarks($_error, $db)
{
if (! $_error && $db != $_REQUEST['newname']) {
if (! $_error && $db != $_POST['newname']) {
$get_fields = ['user', 'label', 'query'];
$where_fields = ['dbase' => $db];
$new_fields = ['dbase' => $_REQUEST['newname']];
$new_fields = ['dbase' => $_POST['newname']];
Table::duplicateInfo(
'bookmarkwork',
'bookmark',
@ -1793,9 +1795,9 @@ class Operations
$sql_query = 'ALTER TABLE '
. Util::backquote($GLOBALS['table'])
. ' ORDER BY '
. Util::backquote(urldecode($_REQUEST['order_field']));
if (isset($_REQUEST['order_order'])
&& $_REQUEST['order_order'] === 'desc'
. Util::backquote(urldecode($_POST['order_field']));
if (isset($_POST['order_order'])
&& $_POST['order_order'] === 'desc'
) {
$sql_query .= ' DESC';
} else {
@ -1837,11 +1839,11 @@ class Operations
$table_alters = [];
if (isset($_REQUEST['comment'])
&& urldecode($_REQUEST['prev_comment']) !== $_REQUEST['comment']
if (isset($_POST['comment'])
&& urldecode($_POST['prev_comment']) !== $_POST['comment']
) {
$table_alters[] = 'COMMENT = \''
. $this->dbi->escapeString($_REQUEST['comment']) . '\'';
. $this->dbi->escapeString($_POST['comment']) . '\'';
}
if (! empty($newTblStorageEngine)
@ -1849,62 +1851,62 @@ class Operations
) {
$table_alters[] = 'ENGINE = ' . $newTblStorageEngine;
}
if (! empty($_REQUEST['tbl_collation'])
&& $_REQUEST['tbl_collation'] !== $tbl_collation
if (! empty($_POST['tbl_collation'])
&& $_POST['tbl_collation'] !== $tbl_collation
) {
$table_alters[] = 'DEFAULT '
. Util::getCharsetQueryPart($_REQUEST['tbl_collation']);
. Util::getCharsetQueryPart($_POST['tbl_collation']);
}
if ($pma_table->isEngine(['MYISAM', 'ARIA', 'ISAM'])
&& isset($_REQUEST['new_pack_keys'])
&& $_REQUEST['new_pack_keys'] != (string)$pack_keys
&& isset($_POST['new_pack_keys'])
&& $_POST['new_pack_keys'] != (string)$pack_keys
) {
$table_alters[] = 'pack_keys = ' . $_REQUEST['new_pack_keys'];
$table_alters[] = 'pack_keys = ' . $_POST['new_pack_keys'];
}
$_REQUEST['new_checksum'] = empty($_REQUEST['new_checksum']) ? '0' : '1';
$_POST['new_checksum'] = empty($_POST['new_checksum']) ? '0' : '1';
if ($pma_table->isEngine(['MYISAM', 'ARIA'])
&& $_REQUEST['new_checksum'] !== $checksum
&& $_POST['new_checksum'] !== $checksum
) {
$table_alters[] = 'checksum = ' . $_REQUEST['new_checksum'];
$table_alters[] = 'checksum = ' . $_POST['new_checksum'];
}
$_REQUEST['new_transactional']
= empty($_REQUEST['new_transactional']) ? '0' : '1';
$_POST['new_transactional']
= empty($_POST['new_transactional']) ? '0' : '1';
if ($pma_table->isEngine('ARIA')
&& $_REQUEST['new_transactional'] !== $transactional
&& $_POST['new_transactional'] !== $transactional
) {
$table_alters[] = 'TRANSACTIONAL = ' . $_REQUEST['new_transactional'];
$table_alters[] = 'TRANSACTIONAL = ' . $_POST['new_transactional'];
}
$_REQUEST['new_page_checksum']
= empty($_REQUEST['new_page_checksum']) ? '0' : '1';
$_POST['new_page_checksum']
= empty($_POST['new_page_checksum']) ? '0' : '1';
if ($pma_table->isEngine('ARIA')
&& $_REQUEST['new_page_checksum'] !== $page_checksum
&& $_POST['new_page_checksum'] !== $page_checksum
) {
$table_alters[] = 'PAGE_CHECKSUM = ' . $_REQUEST['new_page_checksum'];
$table_alters[] = 'PAGE_CHECKSUM = ' . $_POST['new_page_checksum'];
}
$_REQUEST['new_delay_key_write']
= empty($_REQUEST['new_delay_key_write']) ? '0' : '1';
$_POST['new_delay_key_write']
= empty($_POST['new_delay_key_write']) ? '0' : '1';
if ($pma_table->isEngine(['MYISAM', 'ARIA'])
&& $_REQUEST['new_delay_key_write'] !== $delay_key_write
&& $_POST['new_delay_key_write'] !== $delay_key_write
) {
$table_alters[] = 'delay_key_write = ' . $_REQUEST['new_delay_key_write'];
$table_alters[] = 'delay_key_write = ' . $_POST['new_delay_key_write'];
}
if ($pma_table->isEngine(['MYISAM', 'ARIA', 'INNODB', 'PBXT'])
&& ! empty($_REQUEST['new_auto_increment'])
&& ! empty($_POST['new_auto_increment'])
&& (! isset($auto_increment)
|| $_REQUEST['new_auto_increment'] !== $auto_increment)
|| $_POST['new_auto_increment'] !== $auto_increment)
) {
$table_alters[] = 'auto_increment = '
. $this->dbi->escapeString($_REQUEST['new_auto_increment']);
. $this->dbi->escapeString($_POST['new_auto_increment']);
}
if (! empty($_REQUEST['new_row_format'])) {
$newRowFormat = $_REQUEST['new_row_format'];
if (! empty($_POST['new_row_format'])) {
$newRowFormat = $_POST['new_row_format'];
$newRowFormatLower = mb_strtolower($newRowFormat);
if ($pma_table->isEngine(['MYISAM', 'ARIA', 'INNODB', 'PBXT'])
&& (strlen($row_format) === 0
@ -1933,8 +1935,8 @@ class Operations
// should not be reported with a Level of Error, so here
// I just ignore it. But there are other 1478 messages
// that it's better to show.
if (! (isset($_REQUEST['new_tbl_storage_engine'])
&& $_REQUEST['new_tbl_storage_engine'] == 'MyISAM'
if (! (isset($_POST['new_tbl_storage_engine'])
&& $_POST['new_tbl_storage_engine'] == 'MyISAM'
&& $warning['Code'] == '1478'
&& $warning['Level'] == 'Error')
) {
@ -1955,13 +1957,13 @@ class Operations
{
$sql_query = 'ALTER TABLE '
. Util::backquote($GLOBALS['table']) . ' '
. $_REQUEST['partition_operation']
. $_POST['partition_operation']
. ' PARTITION ';
if ($_REQUEST['partition_operation'] == 'COALESCE') {
$sql_query .= count($_REQUEST['partition_name']);
if ($_POST['partition_operation'] == 'COALESCE') {
$sql_query .= count($_POST['partition_name']);
} else {
$sql_query .= implode(', ', $_REQUEST['partition_name']) . ';';
$sql_query .= implode(', ', $_POST['partition_name']) . ';';
}
$result = $this->dbi->query($sql_query);
@ -2110,19 +2112,19 @@ class Operations
$this->dbi->selectDb($db);
/**
* $_REQUEST['target_db'] could be empty in case we came from an input field
* $_POST['target_db'] could be empty in case we came from an input field
* (when there are many databases, no drop-down)
*/
if (empty($_REQUEST['target_db'])) {
$_REQUEST['target_db'] = $db;
if (empty($_POST['target_db'])) {
$_POST['target_db'] = $db;
}
/**
* A target table name has been sent to this script -> do the work
*/
if (Core::isValid($_REQUEST['new_name'])) {
if ($db == $_REQUEST['target_db'] && $table == $_REQUEST['new_name']) {
if (isset($_REQUEST['submit_move'])) {
if (Core::isValid($_POST['new_name'])) {
if ($db == $_POST['target_db'] && $table == $_POST['new_name']) {
if (isset($_POST['submit_move'])) {
$message = Message::error(__('Can\'t move table to same one!'));
} else {
$message = Message::error(__('Can\'t copy table to same one!'));
@ -2131,33 +2133,33 @@ class Operations
Table::moveCopy(
$db,
$table,
$_REQUEST['target_db'],
$_REQUEST['new_name'],
$_REQUEST['what'],
isset($_REQUEST['submit_move']),
$_POST['target_db'],
$_POST['new_name'],
$_POST['what'],
isset($_POST['submit_move']),
'one_table'
);
if (isset($_REQUEST['adjust_privileges'])
&& ! empty($_REQUEST['adjust_privileges'])
if (isset($_POST['adjust_privileges'])
&& ! empty($_POST['adjust_privileges'])
) {
if (isset($_REQUEST['submit_move'])) {
if (isset($_POST['submit_move'])) {
$this->adjustPrivilegesRenameOrMoveTable(
$db,
$table,
$_REQUEST['target_db'],
$_REQUEST['new_name']
$_POST['target_db'],
$_POST['new_name']
);
} else {
$this->adjustPrivilegesCopyTable(
$db,
$table,
$_REQUEST['target_db'],
$_REQUEST['new_name']
$_POST['target_db'],
$_POST['new_name']
);
}
if (isset($_REQUEST['submit_move'])) {
if (isset($_POST['submit_move'])) {
$message = Message::success(
__(
'Table %s has been moved to %s. Privileges have been '
@ -2173,7 +2175,7 @@ class Operations
);
}
} else {
if (isset($_REQUEST['submit_move'])) {
if (isset($_POST['submit_move'])) {
$message = Message::success(
__('Table %s has been moved to %s.')
);
@ -2188,20 +2190,20 @@ class Operations
. Util::backquote($table);
$message->addParam($old);
$new_name = $_REQUEST['new_name'];
$new_name = $_POST['new_name'];
if ($this->dbi->getLowerCaseNames() === '1') {
$new_name = strtolower($new_name);
}
$GLOBALS['table'] = $new_name;
$new = Util::backquote($_REQUEST['target_db']) . '.'
$new = Util::backquote($_POST['target_db']) . '.'
. Util::backquote($new_name);
$message->addParam($new);
/* Check: Work on new table or on old table? */
if (isset($_REQUEST['submit_move'])
|| Core::isValid($_REQUEST['switch_to_new'])
if (isset($_POST['submit_move'])
|| Core::isValid($_POST['switch_to_new'])
) {
}
}

View File

@ -2095,7 +2095,7 @@ class Relation
{
$retval = '';
$url_query = Url::getCommon(['db' => $GLOBALS['db']]);
$url_query = Url::getCommon(['db' => $GLOBALS['db']], '');
if ($allTables) {
if ($createDb) {
$url_query .= '&amp;goto=db_operations.php&amp;create_pmadb=1';
@ -2120,7 +2120,7 @@ class Relation
__('%sCreate%s missing phpMyAdmin configuration storage tables.')
);
}
$message->addParamHtml('<a href="./chk_rel.php' . $url_query . '">');
$message->addParamHtml('<a href="./chk_rel.php" data-post="' . $url_query . '">');
$message->addParamHtml('</a>');
$retval .= $message->getDisplay();

View File

@ -68,7 +68,7 @@ class ReplicationGui
public function getHtmlForMasterReplication()
{
$html = '';
if (! isset($_REQUEST['repl_clear_scr'])) {
if (! isset($_POST['repl_clear_scr'])) {
$html .= '<fieldset>';
$html .= '<legend>' . __('Master replication') . '</legend>';
$html .= __('This server is configured as master in a replication process.');
@ -87,16 +87,16 @@ class ReplicationGui
$_url_params['mr_adduser'] = true;
$_url_params['repl_clear_scr'] = true;
$html .= ' <li><a href="server_replication.php';
$html .= Url::getCommon($_url_params)
$html .= ' <li><a href="server_replication.php" data-post="';
$html .= Url::getCommon($_url_params, '')
. '" id="master_addslaveuser_href">';
$html .= __('Add slave replication user') . '</a></li>';
}
// Display 'Add replication slave user' form
if (isset($_REQUEST['mr_adduser'])) {
if (isset($_POST['mr_adduser'])) {
$html .= $this->getHtmlForReplicationMasterAddSlaveUser();
} elseif (! isset($_REQUEST['repl_clear_scr'])) {
} elseif (! isset($_POST['repl_clear_scr'])) {
$html .= "</ul>";
$html .= "</fieldset>";
}
@ -180,8 +180,8 @@ class ReplicationGui
$html .= ' <select name="master_connection">';
$html .= '<option value="">' . __('Default') . '</option>';
foreach ($server_slave_multi_replication as $server) {
$html .= '<option' . (isset($_REQUEST['master_connection'])
&& $_REQUEST['master_connection'] == $server['Connection_name'] ?
$html .= '<option' . (isset($_POST['master_connection'])
&& $_POST['master_connection'] == $server['Connection_name'] ?
' selected="selected"' : '') . '>' . $server['Connection_name']
. '</option>';
}
@ -204,8 +204,7 @@ class ReplicationGui
}
$_url_params['sr_slave_control_parm'] = 'IO_THREAD';
$slave_control_io_link = 'server_replication.php'
. Url::getCommon($_url_params);
$slave_control_io_link = Url::getCommon($_url_params, '');
if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
$_url_params['sr_slave_action'] = 'start';
@ -214,8 +213,7 @@ class ReplicationGui
}
$_url_params['sr_slave_control_parm'] = 'SQL_THREAD';
$slave_control_sql_link = 'server_replication.php'
. Url::getCommon($_url_params);
$slave_control_sql_link = Url::getCommon($_url_params, '');
if ($server_slave_replication[0]['Slave_IO_Running'] == 'No'
|| $server_slave_replication[0]['Slave_SQL_Running'] == 'No'
@ -226,18 +224,15 @@ class ReplicationGui
}
$_url_params['sr_slave_control_parm'] = null;
$slave_control_full_link = 'server_replication.php'
. Url::getCommon($_url_params);
$slave_control_full_link = Url::getCommon($_url_params, '');
$_url_params['sr_slave_action'] = 'reset';
$slave_control_reset_link = 'server_replication.php'
. Url::getCommon($_url_params);
$slave_control_reset_link = Url::getCommon($_url_params, '');
$_url_params = $GLOBALS['url_params'];
$_url_params['sr_take_action'] = true;
$_url_params['sr_slave_skip_error'] = true;
$slave_skip_error_link = 'server_replication.php'
. Url::getCommon($_url_params);
$slave_skip_error_link = Url::getCommon($_url_params, '');
if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
$html .= Message::error(
@ -254,8 +249,7 @@ class ReplicationGui
$_url_params['sl_configure'] = true;
$_url_params['repl_clear_scr'] = true;
$reconfiguremaster_link = 'server_replication.php'
. Url::getCommon($_url_params);
$reconfiguremaster_link = Url::getCommon($_url_params, '');
$html .= __(
'Server is configured as slave in a replication process. Would you ' .
@ -272,26 +266,26 @@ class ReplicationGui
$html .= __('Control slave:') . '</a>';
$html .= ' <div id="slave_control_gui" class="hide">';
$html .= ' <ul>';
$html .= ' <li><a href="' . $slave_control_full_link . '">';
$html .= ' <li><a href="server_replication.php" data-post="' . $slave_control_full_link . '">';
$html .= (($server_slave_replication[0]['Slave_IO_Running'] == 'No' ||
$server_slave_replication[0]['Slave_SQL_Running'] == 'No')
? __('Full start')
: __('Full stop')) . ' </a></li>';
$html .= ' <li><a class="ajax" id="reset_slave"'
. ' href="' . $slave_control_reset_link . '">';
. ' href="server_replication.php" data-post="' . $slave_control_reset_link . '">';
$html .= __('Reset slave') . '</a></li>';
if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') {
$html .= ' <li><a href="' . $slave_control_sql_link . '">';
$html .= ' <li><a href="server_replication.php" data-post="' . $slave_control_sql_link . '">';
$html .= __('Start SQL Thread only') . '</a></li>';
} else {
$html .= ' <li><a href="' . $slave_control_sql_link . '">';
$html .= ' <li><a href="server_replication.php" data-post="' . $slave_control_sql_link . '">';
$html .= __('Stop SQL Thread only') . '</a></li>';
}
if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') {
$html .= ' <li><a href="' . $slave_control_io_link . '">';
$html .= ' <li><a href="server_replication.php" data-post="' . $slave_control_io_link . '">';
$html .= __('Start IO Thread only') . '</a></li>';
} else {
$html .= ' <li><a href="' . $slave_control_io_link . '">';
$html .= ' <li><a href="server_replication.php" data-post="' . $slave_control_io_link . '">';
$html .= __('Stop IO Thread only') . '</a></li>';
}
$html .= ' </ul>';
@ -300,11 +294,11 @@ class ReplicationGui
$html .= ' <li>';
$html .= $this->getHtmlForSlaveErrorManagement($slave_skip_error_link);
$html .= ' </li>';
$html .= ' <li><a href="' . $reconfiguremaster_link . '">';
$html .= ' <li><a href="server_replication.php" data-post="' . $reconfiguremaster_link . '">';
$html .= __('Change or reconfigure master server') . '</a></li>';
$html .= '</ul>';
$html .= '</div>';
} elseif (! isset($_REQUEST['sl_configure'])) {
} elseif (! isset($_POST['sl_configure'])) {
$_url_params = $GLOBALS['url_params'];
$_url_params['sl_configure'] = true;
$_url_params['repl_clear_scr'] = true;
@ -312,9 +306,10 @@ class ReplicationGui
$html .= sprintf(
__(
'This server is not configured as slave in a replication process. '
. 'Would you like to <a href="%s">configure</a> it?'
. 'Would you like to %sconfigure%s it?'
),
'server_replication.php' . Url::getCommon($_url_params)
'<a href="server_replication.php" data-post="' . Url::getCommon($_url_params, '') . '">',
'</a>'
);
}
$html .= '</fieldset>';
@ -339,7 +334,7 @@ class ReplicationGui
__('Skipping errors might lead into unsynchronized master and slave!')
)->getDisplay();
$html .= ' <ul>';
$html .= ' <li><a href="' . $slave_skip_error_link . '">';
$html .= ' <li><a href="server_replication.php" data-post="' . $slave_skip_error_link . '">';
$html .= __('Skip current error') . '</a></li>';
$html .= ' <li>';
$html .= ' <form method="post" action="server_replication.php">';
@ -373,9 +368,10 @@ class ReplicationGui
$html .= sprintf(
__(
'This server is not configured as master in a replication process. '
. 'Would you like to <a href="%s">configure</a> it?'
. 'Would you like to %sconfigure%s it?'
),
'server_replication.php' . Url::getCommon($_url_params)
'<a href="server_replication.php" data-post="' . Url::getCommon($_url_params, '') . '">',
'</a>'
);
$html .= '</fieldset>';
return $html;
@ -707,7 +703,7 @@ class ReplicationGui
list($username_length, $hostname_length)
= $this->getUsernameHostnameLength();
if (isset($_REQUEST['username']) && strlen($_REQUEST['username']) === 0) {
if (isset($_POST['username']) && strlen($_POST['username']) === 0) {
$GLOBALS['pred_username'] = 'any';
}
$html .= '<div id="master_addslaveuser_gui">';
@ -746,8 +742,8 @@ class ReplicationGui
unset($_current_user);
// when we start editing a user, $GLOBALS['pred_hostname'] is not defined
if (! isset($GLOBALS['pred_hostname']) && isset($_REQUEST['hostname'])) {
switch (mb_strtolower($_REQUEST['hostname'])) {
if (! isset($GLOBALS['pred_hostname']) && isset($_POST['hostname'])) {
switch (mb_strtolower($_POST['hostname'])) {
case 'localhost':
case '127.0.0.1':
$GLOBALS['pred_hostname'] = 'localhost';
@ -824,10 +820,10 @@ class ReplicationGui
. '</span>'
. '<input type="text" name="username" id="pma_username" maxlength="'
. $username_length . '" title="' . __('User name') . '"'
. (empty($_REQUEST['username']) ? '' : ' value="'
. (empty($_POST['username']) ? '' : ' value="'
. (isset($GLOBALS['new_username'])
? $GLOBALS['new_username']
: htmlspecialchars($_REQUEST['username'])) . '"')
: htmlspecialchars($_POST['username'])) . '"')
. ' />'
. '</div>';
@ -857,7 +853,7 @@ class ReplicationGui
. '</span>'
. '<input type="text" name="hostname" id="pma_hostname" maxlength="'
. $hostname_length . '" value="'
. (isset($_REQUEST['hostname']) ? htmlspecialchars($_REQUEST['hostname']) : '')
. (isset($_POST['hostname']) ? htmlspecialchars($_POST['hostname']) : '')
. '" title="' . __('Host')
. '" />'
. Util::showHint(
@ -875,12 +871,12 @@ class ReplicationGui
. ' <select name="pred_password" id="select_pred_password" title="'
. __('Password') . '">'
. ' <option value="none"';
if (isset($_REQUEST['username'])) {
if (isset($_POST['username'])) {
$html .= ' selected="selected"';
}
$html .= '>' . __('No Password') . '</option>'
. ' <option value="userdefined"'
. (isset($_REQUEST['username']) ? '' : ' selected="selected"')
. (isset($_POST['username']) ? '' : ' selected="selected"')
. '>' . __('Use text field:') . '</option>'
. ' </select>'
. '</span>'
@ -921,22 +917,22 @@ class ReplicationGui
*/
public function handleControlRequest()
{
if (isset($_REQUEST['sr_take_action'])) {
if (isset($_POST['sr_take_action'])) {
$refresh = false;
$result = false;
$messageSuccess = null;
$messageError = null;
if (isset($_REQUEST['slave_changemaster']) && ! $GLOBALS['cfg']['AllowArbitraryServer']) {
if (isset($_POST['slave_changemaster']) && ! $GLOBALS['cfg']['AllowArbitraryServer']) {
$_SESSION['replication']['sr_action_status'] = 'error';
$_SESSION['replication']['sr_action_info'] = __('Connection to server is disabled, please enable $cfg[\'AllowArbitraryServer\'] in phpMyAdmin configuration.');
} elseif (isset($_REQUEST['slave_changemaster'])) {
} elseif (isset($_POST['slave_changemaster'])) {
$result = $this->handleRequestForSlaveChangeMaster();
} elseif (isset($_REQUEST['sr_slave_server_control'])) {
} elseif (isset($_POST['sr_slave_server_control'])) {
$result = $this->handleRequestForSlaveServerControl();
$refresh = true;
switch ($_REQUEST['sr_slave_action']) {
switch ($_POST['sr_slave_action']) {
case 'start':
$messageSuccess = __('Replication started successfully.');
$messageError = __('Error starting replication.');
@ -954,7 +950,7 @@ class ReplicationGui
$messageError = __('Error.');
break;
}
} elseif (isset($_REQUEST['sr_slave_skip_error'])) {
} elseif (isset($_POST['sr_slave_skip_error'])) {
$result = $this->handleRequestForSlaveSkipError();
}
@ -988,13 +984,13 @@ class ReplicationGui
{
$sr = [];
$_SESSION['replication']['m_username'] = $sr['username']
= $GLOBALS['dbi']->escapeString($_REQUEST['username']);
= $GLOBALS['dbi']->escapeString($_POST['username']);
$_SESSION['replication']['m_password'] = $sr['pma_pw']
= $GLOBALS['dbi']->escapeString($_REQUEST['pma_pw']);
= $GLOBALS['dbi']->escapeString($_POST['pma_pw']);
$_SESSION['replication']['m_hostname'] = $sr['hostname']
= $GLOBALS['dbi']->escapeString($_REQUEST['hostname']);
= $GLOBALS['dbi']->escapeString($_POST['hostname']);
$_SESSION['replication']['m_port'] = $sr['port']
= $GLOBALS['dbi']->escapeString($_REQUEST['text_port']);
= $GLOBALS['dbi']->escapeString($_POST['text_port']);
$_SESSION['replication']['m_correct'] = '';
$_SESSION['replication']['sr_action_status'] = 'error';
$_SESSION['replication']['sr_action_info'] = __('Unknown error');
@ -1060,10 +1056,10 @@ class ReplicationGui
*/
public function handleRequestForSlaveServerControl()
{
if (empty($_REQUEST['sr_slave_control_parm'])) {
$_REQUEST['sr_slave_control_parm'] = null;
if (empty($_POST['sr_slave_control_parm'])) {
$_POST['sr_slave_control_parm'] = null;
}
if ($_REQUEST['sr_slave_action'] == 'reset') {
if ($_POST['sr_slave_action'] == 'reset') {
$qStop = $this->replication->slaveControl("STOP");
$qReset = $GLOBALS['dbi']->tryQuery("RESET SLAVE;");
$qStart = $this->replication->slaveControl("START");
@ -1073,8 +1069,8 @@ class ReplicationGui
$qStart !== false && $qStart !== -1);
} else {
$qControl = $this->replication->slaveControl(
$_REQUEST['sr_slave_action'],
$_REQUEST['sr_slave_control_parm']
$_POST['sr_slave_action'],
$_POST['sr_slave_control_parm']
);
$result = ($qControl !== false && $qControl !== -1);
@ -1091,8 +1087,8 @@ class ReplicationGui
public function handleRequestForSlaveSkipError()
{
$count = 1;
if (isset($_REQUEST['sr_skip_errors_count'])) {
$count = $_REQUEST['sr_skip_errors_count'] * 1;
if (isset($_POST['sr_skip_errors_count'])) {
$count = $_POST['sr_skip_errors_count'] * 1;
}
$qStop = $this->replication->slaveControl("STOP");

View File

@ -153,8 +153,8 @@ class Events
{
global $_REQUEST, $_POST, $errors, $db;
if (! empty($_REQUEST['editor_process_add'])
|| ! empty($_REQUEST['editor_process_edit'])
if (! empty($_POST['editor_process_add'])
|| ! empty($_POST['editor_process_edit'])
) {
$sql_query = '';
@ -162,15 +162,15 @@ class Events
if (! count($errors)) { // set by PhpMyAdmin\Rte\Routines::getQueryFromRequest()
// Execute the created query
if (! empty($_REQUEST['editor_process_edit'])) {
if (! empty($_POST['editor_process_edit'])) {
// Backup the old trigger, in case something goes wrong
$create_item = $this->dbi->getDefinition(
$db,
'EVENT',
$_REQUEST['item_original_name']
$_POST['item_original_name']
);
$drop_item = "DROP EVENT "
. Util::backquote($_REQUEST['item_original_name'])
. Util::backquote($_POST['item_original_name'])
. ";\n";
$result = $this->dbi->tryQuery($drop_item);
if (! $result) {
@ -205,7 +205,7 @@ class Events
__('Event %1$s has been modified.')
);
$message->addParam(
Util::backquote($_REQUEST['item_name'])
Util::backquote($_POST['item_name'])
);
$sql_query = $drop_item . $item_query;
}
@ -225,7 +225,7 @@ class Events
__('Event %1$s has been created.')
);
$message->addParam(
Util::backquote($_REQUEST['item_name'])
Util::backquote($_POST['item_name'])
);
$sql_query = $item_query;
}
@ -251,12 +251,12 @@ class Events
$response = Response::getInstance();
if ($response->isAjax()) {
if ($message->isSuccess()) {
$events = $this->dbi->getEvents($db, $_REQUEST['item_name']);
$events = $this->dbi->getEvents($db, $_POST['item_name']);
$event = $events[0];
$response->addJSON(
'name',
htmlspecialchars(
mb_strtoupper($_REQUEST['item_name'])
mb_strtoupper($_POST['item_name'])
)
);
if (! empty($event)) {
@ -275,14 +275,14 @@ class Events
* Display a form used to add/edit a trigger, if necessary
*/
if (count($errors)
|| (empty($_REQUEST['editor_process_add'])
&& empty($_REQUEST['editor_process_edit'])
|| (empty($_POST['editor_process_add'])
&& empty($_POST['editor_process_edit'])
&& (! empty($_REQUEST['add_item'])
|| ! empty($_REQUEST['edit_item'])
|| ! empty($_REQUEST['item_changetype'])))
|| ! empty($_POST['item_changetype'])))
) { // FIXME: this must be simpler than that
$operation = '';
if (! empty($_REQUEST['item_changetype'])) {
if (! empty($_POST['item_changetype'])) {
$operation = 'change';
}
// Get the data for the form (if any)
@ -293,8 +293,8 @@ class Events
} elseif (! empty($_REQUEST['edit_item'])) {
$title = __("Edit event");
if (! empty($_REQUEST['item_name'])
&& empty($_REQUEST['editor_process_edit'])
&& empty($_REQUEST['item_changetype'])
&& empty($_POST['editor_process_edit'])
&& empty($_POST['item_changetype'])
) {
$item = $this->getDataFromName($_REQUEST['item_name']);
if ($item !== false) {
@ -330,11 +330,11 @@ class Events
'item_comment',
'item_definer'];
foreach ($indices as $index) {
$retval[$index] = isset($_REQUEST[$index]) ? $_REQUEST[$index] : '';
$retval[$index] = isset($_POST[$index]) ? $_POST[$index] : '';
}
$retval['item_type'] = 'ONE TIME';
$retval['item_type_toggle'] = 'RECURRING';
if (isset($_REQUEST['item_type']) && $_REQUEST['item_type'] == 'RECURRING') {
if (isset($_POST['item_type']) && $_POST['item_type'] == 'RECURRING') {
$retval['item_type'] = 'RECURRING';
$retval['item_type_toggle'] = 'ONE TIME';
}
@ -599,10 +599,10 @@ class Events
global $_REQUEST, $errors, $event_status, $event_type, $event_interval;
$query = 'CREATE ';
if (! empty($_REQUEST['item_definer'])) {
if (mb_strpos($_REQUEST['item_definer'], '@') !== false
if (! empty($_POST['item_definer'])) {
if (mb_strpos($_POST['item_definer'], '@') !== false
) {
$arr = explode('@', $_REQUEST['item_definer']);
$arr = explode('@', $_POST['item_definer']);
$query .= 'DEFINER=' . Util::backquote($arr[0]);
$query .= '@' . Util::backquote($arr[1]) . ' ';
} else {
@ -610,40 +610,40 @@ class Events
}
}
$query .= 'EVENT ';
if (! empty($_REQUEST['item_name'])) {
$query .= Util::backquote($_REQUEST['item_name']) . ' ';
if (! empty($_POST['item_name'])) {
$query .= Util::backquote($_POST['item_name']) . ' ';
} else {
$errors[] = __('You must provide an event name!');
}
$query .= 'ON SCHEDULE ';
if (! empty($_REQUEST['item_type'])
&& in_array($_REQUEST['item_type'], $event_type)
if (! empty($_POST['item_type'])
&& in_array($_POST['item_type'], $event_type)
) {
if ($_REQUEST['item_type'] == 'RECURRING') {
if (! empty($_REQUEST['item_interval_value'])
&& !empty($_REQUEST['item_interval_field'])
&& in_array($_REQUEST['item_interval_field'], $event_interval)
if ($_POST['item_type'] == 'RECURRING') {
if (! empty($_POST['item_interval_value'])
&& !empty($_POST['item_interval_field'])
&& in_array($_POST['item_interval_field'], $event_interval)
) {
$query .= 'EVERY ' . intval($_REQUEST['item_interval_value']) . ' ';
$query .= $_REQUEST['item_interval_field'] . ' ';
$query .= 'EVERY ' . intval($_POST['item_interval_value']) . ' ';
$query .= $_POST['item_interval_field'] . ' ';
} else {
$errors[]
= __('You must provide a valid interval value for the event.');
}
if (! empty($_REQUEST['item_starts'])) {
if (! empty($_POST['item_starts'])) {
$query .= "STARTS '"
. $this->dbi->escapeString($_REQUEST['item_starts'])
. $this->dbi->escapeString($_POST['item_starts'])
. "' ";
}
if (! empty($_REQUEST['item_ends'])) {
if (! empty($_POST['item_ends'])) {
$query .= "ENDS '"
. $this->dbi->escapeString($_REQUEST['item_ends'])
. $this->dbi->escapeString($_POST['item_ends'])
. "' ";
}
} else {
if (! empty($_REQUEST['item_execute_at'])) {
if (! empty($_POST['item_execute_at'])) {
$query .= "AT '"
. $this->dbi->escapeString($_REQUEST['item_execute_at'])
. $this->dbi->escapeString($_POST['item_execute_at'])
. "' ";
} else {
$errors[]
@ -654,26 +654,26 @@ class Events
$errors[] = __('You must provide a valid type for the event.');
}
$query .= 'ON COMPLETION ';
if (empty($_REQUEST['item_preserve'])) {
if (empty($_POST['item_preserve'])) {
$query .= 'NOT ';
}
$query .= 'PRESERVE ';
if (! empty($_REQUEST['item_status'])) {
if (! empty($_POST['item_status'])) {
foreach ($event_status['display'] as $key => $value) {
if ($value == $_REQUEST['item_status']) {
if ($value == $_POST['item_status']) {
$query .= $event_status['query'][$key] . ' ';
break;
}
}
}
if (! empty($_REQUEST['item_comment'])) {
if (! empty($_POST['item_comment'])) {
$query .= "COMMENT '" . $this->dbi->escapeString(
$_REQUEST['item_comment']
$_POST['item_comment']
) . "' ";
}
$query .= 'DO ';
if (! empty($_REQUEST['item_definition'])) {
$query .= $_REQUEST['item_definition'];
if (! empty($_POST['item_definition'])) {
$query .= $_POST['item_definition'];
} else {
$errors[] = __('You must provide an event definition.');
}

View File

@ -170,21 +170,21 @@ class Routines
*/
// FIXME: this must be simpler than that
if (count($errors)
|| ( empty($_REQUEST['editor_process_add'])
&& empty($_REQUEST['editor_process_edit'])
|| ( empty($_POST['editor_process_add'])
&& empty($_POST['editor_process_edit'])
&& (! empty($_REQUEST['add_item']) || ! empty($_REQUEST['edit_item'])
|| ! empty($_REQUEST['routine_addparameter'])
|| ! empty($_REQUEST['routine_removeparameter'])
|| ! empty($_REQUEST['routine_changetype'])))
|| ! empty($_POST['routine_addparameter'])
|| ! empty($_POST['routine_removeparameter'])
|| ! empty($_POST['routine_changetype'])))
) {
// Handle requests to add/remove parameters and changing routine type
// This is necessary when JS is disabled
$operation = '';
if (! empty($_REQUEST['routine_addparameter'])) {
if (! empty($_POST['routine_addparameter'])) {
$operation = 'add';
} elseif (! empty($_REQUEST['routine_removeparameter'])) {
} elseif (! empty($_POST['routine_removeparameter'])) {
$operation = 'remove';
} elseif (! empty($_REQUEST['routine_changetype'])) {
} elseif (! empty($_POST['routine_changetype'])) {
$operation = 'change';
}
// Get the data for the form (if any)
@ -194,12 +194,12 @@ class Routines
$mode = 'add';
} elseif (! empty($_REQUEST['edit_item'])) {
$title = __("Edit routine");
if (! $operation && ! empty($_REQUEST['item_name'])
&& empty($_REQUEST['editor_process_edit'])
if (! $operation && ! empty($_GET['item_name'])
&& empty($_POST['editor_process_edit'])
) {
$routine = $this->getDataFromName(
$_REQUEST['item_name'],
$_REQUEST['item_type']
$_GET['item_name'],
$_GET['item_type']
);
if ($routine !== false) {
$routine['item_original_name'] = $routine['item_name'];
@ -254,8 +254,8 @@ class Routines
*/
public function handleRequestCreateOrEdit(array $errors, $db)
{
if (empty($_REQUEST['editor_process_add'])
&& empty($_REQUEST['editor_process_edit'])
if (empty($_POST['editor_process_add'])
&& empty($_POST['editor_process_edit'])
) {
return $errors;
}
@ -264,29 +264,29 @@ class Routines
$routine_query = $this->getQueryFromRequest();
if (!count($errors)) {
// Execute the created query
if (!empty($_REQUEST['editor_process_edit'])) {
if (!empty($_POST['editor_process_edit'])) {
$isProcOrFunc = in_array(
$_REQUEST['item_original_type'],
$_POST['item_original_type'],
['PROCEDURE', 'FUNCTION']
);
if (!$isProcOrFunc) {
$errors[] = sprintf(
__('Invalid routine type: "%s"'),
htmlspecialchars($_REQUEST['item_original_type'])
htmlspecialchars($_POST['item_original_type'])
);
} else {
// Backup the old routine, in case something goes wrong
$create_routine = $this->dbi->getDefinition(
$db,
$_REQUEST['item_original_type'],
$_REQUEST['item_original_name']
$_POST['item_original_type'],
$_POST['item_original_name']
);
$privilegesBackup = $this->backupPrivileges();
$drop_routine = "DROP {$_REQUEST['item_original_type']} "
. Util::backquote($_REQUEST['item_original_name'])
$drop_routine = "DROP {$_POST['item_original_type']} "
. Util::backquote($_POST['item_original_name'])
. ";\n";
$result = $this->dbi->tryQuery($drop_routine);
if (!$result) {
@ -328,7 +328,7 @@ class Routines
__('Routine %1$s has been created.')
);
$message->addParam(
Util::backquote($_REQUEST['item_name'])
Util::backquote($_POST['item_name'])
);
$sql_query = $routine_query;
}
@ -363,14 +363,14 @@ class Routines
$routines = $this->dbi->getRoutines(
$db,
$_REQUEST['item_type'],
$_REQUEST['item_name']
$_POST['item_type'],
$_POST['item_name']
);
$routine = $routines[0];
$response->addJSON(
'name',
htmlspecialchars(
mb_strtoupper($_REQUEST['item_name'])
mb_strtoupper($_POST['item_name'])
)
);
$response->addJSON('new_row', $this->rteList->getRoutineRow($routine));
@ -391,9 +391,9 @@ class Routines
}
// Backup the Old Privileges before dropping
// if $_REQUEST['item_adjust_privileges'] set
if (! isset($_REQUEST['item_adjust_privileges'])
|| empty($_REQUEST['item_adjust_privileges'])
// if $_POST['item_adjust_privileges'] set
if (! isset($_POST['item_adjust_privileges'])
|| empty($_POST['item_adjust_privileges'])
) {
return [];
}
@ -402,8 +402,8 @@ class Routines
'mysql'
)
. '.' . Util::backquote('procs_priv')
. ' where Routine_name = "' . $_REQUEST['item_original_name']
. '" AND Routine_type = "' . $_REQUEST['item_original_type']
. ' where Routine_name = "' . $_POST['item_original_name']
. '" AND Routine_type = "' . $_POST['item_original_type']
. '";';
$privilegesBackup = $this->dbi->fetchResult(
@ -468,8 +468,8 @@ class Routines
. Util::backquote('procs_priv')
. ' VALUES("' . $priv[0] . '", "'
. $priv[1] . '", "' . $priv[2] . '", "'
. $_REQUEST['item_name'] . '", "'
. $_REQUEST['item_type'] . '", "'
. $_POST['item_name'] . '", "'
. $_POST['item_type'] . '", "'
. $priv[5] . '", "'
. $priv[6] . '", "'
. $priv[7] . '");';
@ -509,7 +509,7 @@ class Routines
);
}
$message->addParam(
Util::backquote($_REQUEST['item_name'])
Util::backquote($_POST['item_name'])
);
return $message;
@ -537,7 +537,7 @@ class Routines
'item_comment',
'item_definer'];
foreach ($indices as $index) {
$retval[$index] = isset($_REQUEST[$index]) ? $_REQUEST[$index] : '';
$retval[$index] = isset($_POST[$index]) ? $_POST[$index] : '';
}
$retval['item_type'] = 'PROCEDURE';
@ -547,8 +547,8 @@ class Routines
$retval['item_type_toggle'] = 'PROCEDURE';
}
$retval['item_original_type'] = 'PROCEDURE';
if (isset($_REQUEST['item_original_type'])
&& $_REQUEST['item_original_type'] == 'FUNCTION'
if (isset($_POST['item_original_type'])
&& $_POST['item_original_type'] == 'FUNCTION'
) {
$retval['item_original_type'] = 'FUNCTION';
}
@ -559,35 +559,35 @@ class Routines
$retval['item_param_length'] = [];
$retval['item_param_opts_num'] = [];
$retval['item_param_opts_text'] = [];
if (isset($_REQUEST['item_param_name'])
&& isset($_REQUEST['item_param_type'])
&& isset($_REQUEST['item_param_length'])
&& isset($_REQUEST['item_param_opts_num'])
&& isset($_REQUEST['item_param_opts_text'])
&& is_array($_REQUEST['item_param_name'])
&& is_array($_REQUEST['item_param_type'])
&& is_array($_REQUEST['item_param_length'])
&& is_array($_REQUEST['item_param_opts_num'])
&& is_array($_REQUEST['item_param_opts_text'])
if (isset($_POST['item_param_name'])
&& isset($_POST['item_param_type'])
&& isset($_POST['item_param_length'])
&& isset($_POST['item_param_opts_num'])
&& isset($_POST['item_param_opts_text'])
&& is_array($_POST['item_param_name'])
&& is_array($_POST['item_param_type'])
&& is_array($_POST['item_param_length'])
&& is_array($_POST['item_param_opts_num'])
&& is_array($_POST['item_param_opts_text'])
) {
if ($_REQUEST['item_type'] == 'PROCEDURE') {
$retval['item_param_dir'] = $_REQUEST['item_param_dir'];
if ($_POST['item_type'] == 'PROCEDURE') {
$retval['item_param_dir'] = $_POST['item_param_dir'];
foreach ($retval['item_param_dir'] as $key => $value) {
if (! in_array($value, $param_directions, true)) {
$retval['item_param_dir'][$key] = '';
}
}
}
$retval['item_param_name'] = $_REQUEST['item_param_name'];
$retval['item_param_type'] = $_REQUEST['item_param_type'];
$retval['item_param_name'] = $_POST['item_param_name'];
$retval['item_param_type'] = $_POST['item_param_type'];
foreach ($retval['item_param_type'] as $key => $value) {
if (! in_array($value, Util::getSupportedDatatypes(), true)) {
$retval['item_param_type'][$key] = '';
}
}
$retval['item_param_length'] = $_REQUEST['item_param_length'];
$retval['item_param_opts_num'] = $_REQUEST['item_param_opts_num'];
$retval['item_param_opts_text'] = $_REQUEST['item_param_opts_text'];
$retval['item_param_length'] = $_POST['item_param_length'];
$retval['item_param_opts_num'] = $_POST['item_param_opts_num'];
$retval['item_param_opts_text'] = $_POST['item_param_opts_text'];
$retval['item_num_params'] = max(
count($retval['item_param_name']),
count($retval['item_param_type']),
@ -597,32 +597,32 @@ class Routines
);
}
$retval['item_returntype'] = '';
if (isset($_REQUEST['item_returntype'])
&& in_array($_REQUEST['item_returntype'], Util::getSupportedDatatypes())
if (isset($_POST['item_returntype'])
&& in_array($_POST['item_returntype'], Util::getSupportedDatatypes())
) {
$retval['item_returntype'] = $_REQUEST['item_returntype'];
$retval['item_returntype'] = $_POST['item_returntype'];
}
$retval['item_isdeterministic'] = '';
if (isset($_REQUEST['item_isdeterministic'])
&& mb_strtolower($_REQUEST['item_isdeterministic']) == 'on'
if (isset($_POST['item_isdeterministic'])
&& mb_strtolower($_POST['item_isdeterministic']) == 'on'
) {
$retval['item_isdeterministic'] = " checked='checked'";
}
$retval['item_securitytype_definer'] = '';
$retval['item_securitytype_invoker'] = '';
if (isset($_REQUEST['item_securitytype'])) {
if ($_REQUEST['item_securitytype'] === 'DEFINER') {
if (isset($_POST['item_securitytype'])) {
if ($_POST['item_securitytype'] === 'DEFINER') {
$retval['item_securitytype_definer'] = " selected='selected'";
} elseif ($_REQUEST['item_securitytype'] === 'INVOKER') {
} elseif ($_POST['item_securitytype'] === 'INVOKER') {
$retval['item_securitytype_invoker'] = " selected='selected'";
}
}
$retval['item_sqldataaccess'] = '';
if (isset($_REQUEST['item_sqldataaccess'])
&& in_array($_REQUEST['item_sqldataaccess'], $param_sqldataaccess, true)
if (isset($_POST['item_sqldataaccess'])
&& in_array($_POST['item_sqldataaccess'], $param_sqldataaccess, true)
) {
$retval['item_sqldataaccess'] = $_REQUEST['item_sqldataaccess'];
$retval['item_sqldataaccess'] = $_POST['item_sqldataaccess'];
}
return $retval;
@ -1151,13 +1151,13 @@ class Routines
{
global $_REQUEST, $errors, $param_sqldataaccess, $param_directions, $dbi;
$_REQUEST['item_type'] = isset($_REQUEST['item_type'])
? $_REQUEST['item_type'] : '';
$_POST['item_type'] = isset($_POST['item_type'])
? $_POST['item_type'] : '';
$query = 'CREATE ';
if (! empty($_REQUEST['item_definer'])) {
if (mb_strpos($_REQUEST['item_definer'], '@') !== false) {
$arr = explode('@', $_REQUEST['item_definer']);
if (! empty($_POST['item_definer'])) {
if (mb_strpos($_POST['item_definer'], '@') !== false) {
$arr = explode('@', $_POST['item_definer']);
$do_backquote = true;
if (substr($arr[0], 0, 1) === "`"
@ -1178,18 +1178,18 @@ class Routines
$errors[] = __('The definer must be in the "username@hostname" format!');
}
}
if ($_REQUEST['item_type'] == 'FUNCTION'
|| $_REQUEST['item_type'] == 'PROCEDURE'
if ($_POST['item_type'] == 'FUNCTION'
|| $_POST['item_type'] == 'PROCEDURE'
) {
$query .= $_REQUEST['item_type'] . ' ';
$query .= $_POST['item_type'] . ' ';
} else {
$errors[] = sprintf(
__('Invalid routine type: "%s"'),
htmlspecialchars($_REQUEST['item_type'])
htmlspecialchars($_POST['item_type'])
);
}
if (! empty($_REQUEST['item_name'])) {
$query .= Util::backquote($_REQUEST['item_name']);
if (! empty($_POST['item_name'])) {
$query .= Util::backquote($_POST['item_name']);
} else {
$errors[] = __('You must provide a routine name!');
}
@ -1197,36 +1197,36 @@ class Routines
$warned_about_dir = false;
$warned_about_length = false;
if (! empty($_REQUEST['item_param_name'])
&& ! empty($_REQUEST['item_param_type'])
&& ! empty($_REQUEST['item_param_length'])
&& is_array($_REQUEST['item_param_name'])
&& is_array($_REQUEST['item_param_type'])
&& is_array($_REQUEST['item_param_length'])
if (! empty($_POST['item_param_name'])
&& ! empty($_POST['item_param_type'])
&& ! empty($_POST['item_param_length'])
&& is_array($_POST['item_param_name'])
&& is_array($_POST['item_param_type'])
&& is_array($_POST['item_param_length'])
) {
$item_param_name = $_REQUEST['item_param_name'];
$item_param_type = $_REQUEST['item_param_type'];
$item_param_length = $_REQUEST['item_param_length'];
$item_param_name = $_POST['item_param_name'];
$item_param_type = $_POST['item_param_type'];
$item_param_length = $_POST['item_param_length'];
for ($i = 0, $nb = count($item_param_name); $i < $nb; $i++) {
if (! empty($item_param_name[$i])
&& ! empty($item_param_type[$i])
) {
if ($_REQUEST['item_type'] == 'PROCEDURE'
&& ! empty($_REQUEST['item_param_dir'][$i])
&& in_array($_REQUEST['item_param_dir'][$i], $param_directions)
if ($_POST['item_type'] == 'PROCEDURE'
&& ! empty($_POST['item_param_dir'][$i])
&& in_array($_POST['item_param_dir'][$i], $param_directions)
) {
$params .= $_REQUEST['item_param_dir'][$i] . " "
$params .= $_POST['item_param_dir'][$i] . " "
. Util::backquote($item_param_name[$i])
. " " . $item_param_type[$i];
} elseif ($_REQUEST['item_type'] == 'FUNCTION') {
} elseif ($_POST['item_type'] == 'FUNCTION') {
$params .= Util::backquote($item_param_name[$i])
. " " . $item_param_type[$i];
} elseif (! $warned_about_dir) {
$warned_about_dir = true;
$errors[] = sprintf(
__('Invalid direction "%s" given for parameter.'),
htmlspecialchars($_REQUEST['item_param_dir'][$i])
htmlspecialchars($_POST['item_param_dir'][$i])
);
}
if ($item_param_length[$i] != ''
@ -1252,21 +1252,21 @@ class Routines
);
}
}
if (! empty($_REQUEST['item_param_opts_text'][$i])) {
if (! empty($_POST['item_param_opts_text'][$i])) {
if ($dbi->types->getTypeClass($item_param_type[$i]) == 'CHAR') {
if (! in_array($item_param_type[$i], ['VARBINARY', 'BINARY'])) {
$params .= ' CHARSET '
. mb_strtolower(
$_REQUEST['item_param_opts_text'][$i]
$_POST['item_param_opts_text'][$i]
);
}
}
}
if (! empty($_REQUEST['item_param_opts_num'][$i])) {
if (! empty($_POST['item_param_opts_num'][$i])) {
if ($dbi->types->getTypeClass($item_param_type[$i]) == 'NUMBER') {
$params .= ' '
. mb_strtoupper(
$_REQUEST['item_param_opts_num'][$i]
$_POST['item_param_opts_num'][$i]
);
}
}
@ -1282,9 +1282,9 @@ class Routines
}
}
$query .= "(" . $params . ") ";
if ($_REQUEST['item_type'] == 'FUNCTION') {
$item_returntype = isset($_REQUEST['item_returntype'])
? $_REQUEST['item_returntype']
if ($_POST['item_type'] == 'FUNCTION') {
$item_returntype = isset($_POST['item_returntype'])
? $_POST['item_returntype']
: null;
if (! empty($item_returntype)
@ -1297,15 +1297,15 @@ class Routines
} else {
$errors[] = __('You must provide a valid return type for the routine.');
}
if (! empty($_REQUEST['item_returnlength'])
if (! empty($_POST['item_returnlength'])
&& !preg_match(
'@^(DATE|DATETIME|TIME|TINYBLOB|TINYTEXT|BLOB|TEXT|'
. 'MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|SERIAL|BOOLEAN)$@i',
$item_returntype
)
) {
$query .= "(" . $_REQUEST['item_returnlength'] . ")";
} elseif (empty($_REQUEST['item_returnlength'])
$query .= "(" . $_POST['item_returnlength'] . ")";
} elseif (empty($_POST['item_returnlength'])
&& preg_match(
'@^(ENUM|SET|VARCHAR|VARBINARY)$@i',
$item_returntype
@ -1318,43 +1318,43 @@ class Routines
);
}
}
if (! empty($_REQUEST['item_returnopts_text'])) {
if (! empty($_POST['item_returnopts_text'])) {
if ($dbi->types->getTypeClass($item_returntype) == 'CHAR') {
$query .= ' CHARSET '
. mb_strtolower($_REQUEST['item_returnopts_text']);
. mb_strtolower($_POST['item_returnopts_text']);
}
}
if (! empty($_REQUEST['item_returnopts_num'])) {
if (! empty($_POST['item_returnopts_num'])) {
if ($dbi->types->getTypeClass($item_returntype) == 'NUMBER') {
$query .= ' '
. mb_strtoupper($_REQUEST['item_returnopts_num']);
. mb_strtoupper($_POST['item_returnopts_num']);
}
}
$query .= ' ';
}
if (! empty($_REQUEST['item_comment'])) {
$query .= "COMMENT '" . $this->dbi->escapeString($_REQUEST['item_comment'])
if (! empty($_POST['item_comment'])) {
$query .= "COMMENT '" . $this->dbi->escapeString($_POST['item_comment'])
. "' ";
}
if (isset($_REQUEST['item_isdeterministic'])) {
if (isset($_POST['item_isdeterministic'])) {
$query .= 'DETERMINISTIC ';
} else {
$query .= 'NOT DETERMINISTIC ';
}
if (! empty($_REQUEST['item_sqldataaccess'])
&& in_array($_REQUEST['item_sqldataaccess'], $param_sqldataaccess)
if (! empty($_POST['item_sqldataaccess'])
&& in_array($_POST['item_sqldataaccess'], $param_sqldataaccess)
) {
$query .= $_REQUEST['item_sqldataaccess'] . ' ';
$query .= $_POST['item_sqldataaccess'] . ' ';
}
if (! empty($_REQUEST['item_securitytype'])) {
if ($_REQUEST['item_securitytype'] == 'DEFINER'
|| $_REQUEST['item_securitytype'] == 'INVOKER'
if (! empty($_POST['item_securitytype'])) {
if ($_POST['item_securitytype'] == 'DEFINER'
|| $_POST['item_securitytype'] == 'INVOKER'
) {
$query .= 'SQL SECURITY ' . $_REQUEST['item_securitytype'] . ' ';
$query .= 'SQL SECURITY ' . $_POST['item_securitytype'] . ' ';
}
}
if (! empty($_REQUEST['item_definition'])) {
$query .= $_REQUEST['item_definition'];
if (! empty($_POST['item_definition'])) {
$query .= $_POST['item_definition'];
} else {
$errors[] = __('You must provide a routine definition.');
}
@ -1376,18 +1376,18 @@ class Routines
/**
* Handle all user requests other than the default of listing routines
*/
if (! empty($_REQUEST['execute_routine']) && ! empty($_REQUEST['item_name'])) {
if (! empty($_POST['execute_routine']) && ! empty($_POST['item_name'])) {
// Build the queries
$routine = $this->getDataFromName(
$_REQUEST['item_name'],
$_REQUEST['item_type'],
$_POST['item_name'],
$_POST['item_type'],
false
);
if ($routine === false) {
$message = __('Error in processing request:') . ' ';
$message .= sprintf(
$this->words->get('not_found'),
htmlspecialchars(Util::backquote($_REQUEST['item_name'])),
htmlspecialchars(Util::backquote($_POST['item_name'])),
htmlspecialchars(Util::backquote($db))
);
$message = Message::error($message);
@ -1406,20 +1406,20 @@ class Routines
$args = [];
$all_functions = $this->dbi->types->getAllFunctions();
for ($i = 0; $i < $routine['item_num_params']; $i++) {
if (isset($_REQUEST['params'][$routine['item_param_name'][$i]])) {
$value = $_REQUEST['params'][$routine['item_param_name'][$i]];
if (isset($_POST['params'][$routine['item_param_name'][$i]])) {
$value = $_POST['params'][$routine['item_param_name'][$i]];
if (is_array($value)) { // is SET type
$value = implode(',', $value);
}
$value = $this->dbi->escapeString($value);
if (! empty($_REQUEST['funcs'][$routine['item_param_name'][$i]])
if (! empty($_POST['funcs'][$routine['item_param_name'][$i]])
&& in_array(
$_REQUEST['funcs'][$routine['item_param_name'][$i]],
$_POST['funcs'][$routine['item_param_name'][$i]],
$all_functions
)
) {
$queries[] = "SET @p$i="
. $_REQUEST['funcs'][$routine['item_param_name'][$i]]
. $_POST['funcs'][$routine['item_param_name'][$i]]
. "('$value');\n";
} else {
$queries[] = "SET @p$i='$value';\n";
@ -1592,7 +1592,7 @@ class Routines
$message = __('Error in processing request:') . ' ';
$message .= sprintf(
$this->words->get('not_found'),
htmlspecialchars(Util::backquote($_REQUEST['item_name'])),
htmlspecialchars(Util::backquote($_GET['item_name'])),
htmlspecialchars(Util::backquote($db))
);
$message = Message::error($message);

View File

@ -129,8 +129,8 @@ class Triggers
{
global $_REQUEST, $_POST, $errors, $db, $table;
if (! empty($_REQUEST['editor_process_add'])
|| ! empty($_REQUEST['editor_process_edit'])
if (! empty($_POST['editor_process_add'])
|| ! empty($_POST['editor_process_edit'])
) {
$sql_query = '';
@ -138,9 +138,9 @@ class Triggers
if (! count($errors)) { // set by PhpMyAdmin\Rte\Routines::getQueryFromRequest()
// Execute the created query
if (! empty($_REQUEST['editor_process_edit'])) {
if (! empty($_POST['editor_process_edit'])) {
// Backup the old trigger, in case something goes wrong
$trigger = $this->getDataFromName($_REQUEST['item_original_name']);
$trigger = $this->getDataFromName($_POST['item_original_name']);
$create_item = $trigger['create'];
$drop_item = $trigger['drop'] . ';';
$result = $this->dbi->tryQuery($drop_item);
@ -177,7 +177,7 @@ class Triggers
__('Trigger %1$s has been modified.')
);
$message->addParam(
Util::backquote($_REQUEST['item_name'])
Util::backquote($_POST['item_name'])
);
$sql_query = $drop_item . $item_query;
}
@ -197,7 +197,7 @@ class Triggers
__('Trigger %1$s has been created.')
);
$message->addParam(
Util::backquote($_REQUEST['item_name'])
Util::backquote($_POST['item_name'])
);
$sql_query = $item_query;
}
@ -226,7 +226,7 @@ class Triggers
$items = $this->dbi->getTriggers($db, $table, '');
$trigger = false;
foreach ($items as $value) {
if ($value['name'] == $_REQUEST['item_name']) {
if ($value['name'] == $_POST['item_name']) {
$trigger = $value;
}
}
@ -240,7 +240,7 @@ class Triggers
'name',
htmlspecialchars(
mb_strtoupper(
$_REQUEST['item_name']
$_POST['item_name']
)
)
);
@ -259,8 +259,8 @@ class Triggers
* Display a form used to add/edit a trigger, if necessary
*/
if (count($errors)
|| (empty($_REQUEST['editor_process_add'])
&& empty($_REQUEST['editor_process_edit'])
|| (empty($_POST['editor_process_add'])
&& empty($_POST['editor_process_edit'])
&& (! empty($_REQUEST['add_item'])
|| ! empty($_REQUEST['edit_item']))) // FIXME: this must be simpler than that
) {
@ -272,7 +272,7 @@ class Triggers
} elseif (! empty($_REQUEST['edit_item'])) {
$title = __("Edit trigger");
if (! empty($_REQUEST['item_name'])
&& empty($_REQUEST['editor_process_edit'])
&& empty($_POST['editor_process_edit'])
) {
$item = $this->getDataFromName($_REQUEST['item_name']);
if ($item !== false) {
@ -303,7 +303,7 @@ class Triggers
'item_definition',
'item_definer'];
foreach ($indices as $index) {
$retval[$index] = isset($_REQUEST[$index]) ? $_REQUEST[$index] : '';
$retval[$index] = isset($_POST[$index]) ? $_POST[$index] : '';
}
return $retval;
}
@ -480,10 +480,10 @@ class Triggers
global $_REQUEST, $db, $errors, $action_timings, $event_manipulations;
$query = 'CREATE ';
if (! empty($_REQUEST['item_definer'])) {
if (mb_strpos($_REQUEST['item_definer'], '@') !== false
if (! empty($_POST['item_definer'])) {
if (mb_strpos($_POST['item_definer'], '@') !== false
) {
$arr = explode('@', $_REQUEST['item_definer']);
$arr = explode('@', $_POST['item_definer']);
$query .= 'DEFINER=' . Util::backquote($arr[0]);
$query .= '@' . Util::backquote($arr[1]) . ' ';
} else {
@ -491,36 +491,36 @@ class Triggers
}
}
$query .= 'TRIGGER ';
if (! empty($_REQUEST['item_name'])) {
$query .= Util::backquote($_REQUEST['item_name']) . ' ';
if (! empty($_POST['item_name'])) {
$query .= Util::backquote($_POST['item_name']) . ' ';
} else {
$errors[] = __('You must provide a trigger name!');
}
if (! empty($_REQUEST['item_timing'])
&& in_array($_REQUEST['item_timing'], $action_timings)
if (! empty($_POST['item_timing'])
&& in_array($_POST['item_timing'], $action_timings)
) {
$query .= $_REQUEST['item_timing'] . ' ';
$query .= $_POST['item_timing'] . ' ';
} else {
$errors[] = __('You must provide a valid timing for the trigger!');
}
if (! empty($_REQUEST['item_event'])
&& in_array($_REQUEST['item_event'], $event_manipulations)
if (! empty($_POST['item_event'])
&& in_array($_POST['item_event'], $event_manipulations)
) {
$query .= $_REQUEST['item_event'] . ' ';
$query .= $_POST['item_event'] . ' ';
} else {
$errors[] = __('You must provide a valid event for the trigger!');
}
$query .= 'ON ';
if (! empty($_REQUEST['item_table'])
&& in_array($_REQUEST['item_table'], $this->dbi->getTables($db))
if (! empty($_POST['item_table'])
&& in_array($_POST['item_table'], $this->dbi->getTables($db))
) {
$query .= Util::backquote($_REQUEST['item_table']);
$query .= Util::backquote($_POST['item_table']);
} else {
$errors[] = __('You must provide a valid table name!');
}
$query .= ' FOR EACH ROW ';
if (! empty($_REQUEST['item_definition'])) {
$query .= $_REQUEST['item_definition'];
if (! empty($_POST['item_definition'])) {
$query .= $_POST['item_definition'];
} else {
$errors[] = __('You must provide a trigger definition.');
}

View File

@ -78,7 +78,7 @@ class Privileges
public function getHtmlForUserGroupDialog($username, $is_menuswork)
{
$html = '';
if (! empty($_REQUEST['edit_user_group_dialog']) && $is_menuswork) {
if (! empty($_GET['edit_user_group_dialog']) && $is_menuswork) {
$dialog = $this->getHtmlToChooseUserGroup($username);
$response = Response::getInstance();
if ($response->isAjax()) {
@ -1949,7 +1949,7 @@ class Privileges
// similar logic in user_password.php
$message = null;
if (empty($_REQUEST['nopass'])
if (empty($_POST['nopass'])
&& isset($_POST['pma_pw'])
&& isset($_POST['pma_pw2'])
) {
@ -1966,8 +1966,8 @@ class Privileges
$serverType = Util::getServerType();
$serverVersion = $this->dbi->getVersion();
$authentication_plugin
= (isset($_REQUEST['authentication_plugin'])
? $_REQUEST['authentication_plugin']
= (isset($_POST['authentication_plugin'])
? $_POST['authentication_plugin']
: $this->getCurrentAuthenticationPlugin(
'change',
$username,
@ -2234,7 +2234,7 @@ class Privileges
}
/**
* Get HTML for addUsersForm, This function call if isset($_REQUEST['adduser'])
* Get HTML for addUsersForm, This function call if isset($_GET['adduser'])
*
* @param string $dbname database name
*
@ -2915,9 +2915,13 @@ class Privileges
break;
}
$html .= ' href="server_privileges.php'
. Url::getCommon($params)
. '">';
$html .= ' href="server_privileges.php';
if ($linktype == 'revoke') {
$html .= '" data-post="' . Url::getCommon($params, '');
} else {
$html .= Url::getCommon($params);
}
$html .= '">';
switch ($linktype) {
case 'edit':
@ -3045,7 +3049,7 @@ class Privileges
$extra_data['sql_query'] = Util::getMessage(null, $sql_query);
}
if (isset($_REQUEST['change_copy'])) {
if (isset($_POST['change_copy'])) {
/**
* generate html on the fly for the new user that was just created.
*/
@ -3057,7 +3061,7 @@ class Privileges
. '&amp;#27;' . htmlspecialchars($hostname) . '" />'
. '</td>' . "\n"
. '<td><label for="checkbox_sel_users_">'
. (empty($_REQUEST['username'])
. (empty($_POST['username'])
? '<span style="color: #FF0000">' . __('Any') . '</span>'
: htmlspecialchars($username) ) . '</label></td>' . "\n"
. '<td>' . htmlspecialchars($hostname) . '</td>' . "\n";
@ -3146,9 +3150,9 @@ class Privileges
$extra_data['new_privileges'] = $new_privileges;
}
if (isset($_REQUEST['validate_username'])) {
if (isset($_GET['validate_username'])) {
$sql_query = "SELECT * FROM `mysql`.`user` WHERE `User` = '"
. $_REQUEST['username'] . "';";
. $_GET['username'] . "';";
$res = $this->dbi->query($sql_query);
$row = $this->dbi->fetchRow($res);
if (empty($row)) {
@ -3868,7 +3872,7 @@ class Privileges
return $this->template->render('server/privileges/initials_row', [
'array_initials' => $array_initials,
'initial' => isset($_REQUEST['initial']) ? $_REQUEST['initial'] : null,
'initial' => isset($_GET['initial']) ? $_GET['initial'] : null,
]);
}
@ -3936,7 +3940,7 @@ class Privileges
if (empty($queries)) {
$message = Message::error(__('No users selected for deleting!'));
} else {
if ($_REQUEST['mode'] == 3) {
if ($_POST['mode'] == 3) {
$queries[] = '# ' . __('Reloading the privileges') . ' …';
$queries[] = 'FLUSH PRIVILEGES;';
}
@ -4047,11 +4051,11 @@ class Privileges
$queries = null;
$password = null;
if (isset($_REQUEST['change_copy'])) {
if (isset($_POST['change_copy'])) {
$user_host_condition = ' WHERE `User` = '
. "'" . $this->dbi->escapeString($_REQUEST['old_username']) . "'"
. "'" . $this->dbi->escapeString($_POST['old_username']) . "'"
. ' AND `Host` = '
. "'" . $this->dbi->escapeString($_REQUEST['old_hostname']) . "';";
. "'" . $this->dbi->escapeString($_POST['old_hostname']) . "';";
$row = $this->dbi->fetchSingleRow(
'SELECT * FROM `mysql`.`user` ' . $user_host_condition
);
@ -4060,7 +4064,7 @@ class Privileges
$response->addHTML(
Message::notice(__('No user found.'))->getDisplay()
);
unset($_REQUEST['change_copy']);
unset($_POST['change_copy']);
} else {
foreach ($row as $key => $value) {
$GLOBALS[$key] = $value;
@ -4117,12 +4121,12 @@ class Privileges
*/
public function getDataForDeleteUsers($queries)
{
if (isset($_REQUEST['change_copy'])) {
if (isset($_POST['change_copy'])) {
$selected_usr = [
$_REQUEST['old_username'] . '&amp;#27;' . $_REQUEST['old_hostname']
$_POST['old_username'] . '&amp;#27;' . $_POST['old_hostname']
];
} else {
$selected_usr = $_REQUEST['selected_usr'];
$selected_usr = $_POST['selected_usr'];
$queries = [];
}
@ -4144,7 +4148,7 @@ class Privileges
. '\'@\'' . $this->dbi->escapeString($this_host) . '\';';
$this->relationCleanup->user($this_user);
if (isset($_REQUEST['drop_users_db'])) {
if (isset($_POST['drop_users_db'])) {
$queries[] = 'DROP DATABASE IF EXISTS '
. Util::backquote($this_user) . ';';
$GLOBALS['reload'] = true;
@ -4161,7 +4165,7 @@ class Privileges
public function updateMessageForReload()
{
$message = null;
if (isset($_REQUEST['flush_privileges'])) {
if (isset($_GET['flush_privileges'])) {
$sql_query = 'FLUSH PRIVILEGES;';
$this->dbi->query($sql_query);
$message = Message::success(
@ -4169,7 +4173,7 @@ class Privileges
);
}
if (isset($_REQUEST['validate_username'])) {
if (isset($_GET['validate_username'])) {
$message = Message::success();
}
@ -4226,7 +4230,7 @@ class Privileges
$queries_for_display = null;
$sql_query = null;
if (!isset($_REQUEST['adduser_submit']) && !isset($_REQUEST['change_copy'])) {
if (!isset($_POST['adduser_submit']) && !isset($_POST['change_copy'])) {
return [
$message, $queries, $queries_for_display, $sql_query, $_add_user_error
];
@ -4261,7 +4265,7 @@ class Privileges
if ($this->dbi->fetchValue($sql) == 1) {
$message = Message::error(__('The user %s already exists!'));
$message->addParam('[em]\'' . $username . '\'@\'' . $hostname . '\'[/em]');
$_REQUEST['adduser'] = true;
$_GET['adduser'] = true;
$_add_user_error = true;
return [
@ -4282,7 +4286,7 @@ class Privileges
(isset($password) ? $password : '')
);
if (empty($_REQUEST['change_copy'])) {
if (empty($_POST['change_copy'])) {
$_error = false;
if (! is_null($create_user_real)) {
@ -4290,10 +4294,10 @@ class Privileges
$_error = true;
}
if (isset($password_set_real) && !empty($password_set_real)
&& isset($_REQUEST['authentication_plugin'])
&& isset($_POST['authentication_plugin'])
) {
$this->setProperPasswordHashing(
$_REQUEST['authentication_plugin']
$_POST['authentication_plugin']
);
if ($this->dbi->tryQuery($password_set_real)) {
$sql_query .= $password_set_show;
@ -4310,8 +4314,8 @@ class Privileges
$hostname,
$dbname
);
if (!empty($_REQUEST['userGroup']) && $is_menuwork) {
$this->setUserGroup($GLOBALS['username'], $_REQUEST['userGroup']);
if (!empty($_POST['userGroup']) && $is_menuwork) {
$this->setUserGroup($GLOBALS['username'], $_POST['userGroup']);
}
return [
@ -4325,8 +4329,8 @@ class Privileges
// Copy the user group while copying a user
$old_usergroup =
isset($_REQUEST['old_usergroup']) ? $_REQUEST['old_usergroup'] : null;
$this->setUserGroup($_REQUEST['username'], $old_usergroup);
isset($_POST['old_usergroup']) ? $_POST['old_usergroup'] : null;
$this->setUserGroup($_POST['username'], $old_usergroup);
if (is_null($create_user_real)) {
$queries[] = $create_user_real;
@ -4334,10 +4338,10 @@ class Privileges
$queries[] = $real_sql_query;
if (isset($password_set_real) && ! empty($password_set_real)
&& isset($_REQUEST['authentication_plugin'])
&& isset($_POST['authentication_plugin'])
) {
$this->setProperPasswordHashing(
$_REQUEST['authentication_plugin']
$_POST['authentication_plugin']
);
$queries[] = $password_set_real;
@ -4406,25 +4410,25 @@ class Privileges
/**
* Checks if a dropdown box has been used for selecting a database / table
*/
if (Core::isValid($_REQUEST['pred_tablename'])) {
$tablename = $_REQUEST['pred_tablename'];
if (Core::isValid($_POST['pred_tablename'])) {
$tablename = $_POST['pred_tablename'];
} elseif (Core::isValid($_REQUEST['tablename'])) {
$tablename = $_REQUEST['tablename'];
} else {
unset($tablename);
}
if (Core::isValid($_REQUEST['pred_routinename'])) {
$routinename = $_REQUEST['pred_routinename'];
if (Core::isValid($_POST['pred_routinename'])) {
$routinename = $_POST['pred_routinename'];
} elseif (Core::isValid($_REQUEST['routinename'])) {
$routinename = $_REQUEST['routinename'];
} else {
unset($routinename);
}
if (isset($_REQUEST['pred_dbname'])) {
if (isset($_POST['pred_dbname'])) {
$is_valid_pred_dbname = true;
foreach ($_REQUEST['pred_dbname'] as $key => $db_name) {
foreach ($_POST['pred_dbname'] as $key => $db_name) {
if (! Core::isValid($db_name)) {
$is_valid_pred_dbname = false;
break;
@ -4449,7 +4453,7 @@ class Privileges
}
if (isset($is_valid_pred_dbname) && $is_valid_pred_dbname) {
$dbname = $_REQUEST['pred_dbname'];
$dbname = $_POST['pred_dbname'];
// If dbname contains only one database.
if (count($dbname) == 1) {
$dbname = $dbname[0];
@ -4518,14 +4522,14 @@ class Privileges
{
$export = '<textarea class="export" cols="60" rows="15">';
if (isset($_REQUEST['selected_usr'])) {
if (isset($_POST['selected_usr'])) {
// export privileges for selected users
$title = __('Privileges');
//For removing duplicate entries of users
$_REQUEST['selected_usr'] = array_unique($_REQUEST['selected_usr']);
$_POST['selected_usr'] = array_unique($_POST['selected_usr']);
foreach ($_REQUEST['selected_usr'] as $export_user) {
foreach ($_POST['selected_usr'] as $export_user) {
$export_username = mb_substr(
$export_user,
0,
@ -4727,8 +4731,8 @@ class Privileges
" IF(`" . $password_column . "` = _latin1 '', 'N', 'Y') AS 'Password'" .
' FROM `mysql`.`user`';
$sql_query .= (isset($_REQUEST['initial'])
? $this->rangeOfUsers($_REQUEST['initial'])
$sql_query .= (isset($_GET['initial'])
? $this->rangeOfUsers($_GET['initial'])
: '');
$sql_query .= ' ORDER BY `User` ASC, `Host` ASC;';
@ -4808,8 +4812,8 @@ class Privileges
* Display the user overview
* (if less than 50 users, display them immediately)
*/
if (isset($_REQUEST['initial'])
|| isset($_REQUEST['showall'])
if (isset($_GET['initial'])
|| isset($_GET['showall'])
|| $this->dbi->numRows($res) < 50
) {
$html_output .= $this->getUsersOverview(
@ -5015,9 +5019,9 @@ class Privileges
'SELECT `Column_name`, `Column_priv`'
. ' FROM `mysql`.`columns_priv`'
. ' WHERE `User`'
. ' = \'' . $this->dbi->escapeString($_REQUEST['old_username']) . "'"
. ' = \'' . $this->dbi->escapeString($_POST['old_username']) . "'"
. ' AND `Host`'
. ' = \'' . $this->dbi->escapeString($_REQUEST['old_username']) . '\''
. ' = \'' . $this->dbi->escapeString($_POST['old_username']) . '\''
. ' AND `Db`'
. ' = \'' . $this->dbi->escapeString($row['Db']) . "'"
. ' AND `Table_name`'
@ -5093,9 +5097,9 @@ class Privileges
$hostname
) {
$user_host_condition = ' WHERE `User`'
. ' = \'' . $this->dbi->escapeString($_REQUEST['old_username']) . "'"
. ' = \'' . $this->dbi->escapeString($_POST['old_username']) . "'"
. ' AND `Host`'
. ' = \'' . $this->dbi->escapeString($_REQUEST['old_hostname']) . '\';';
. ' = \'' . $this->dbi->escapeString($_POST['old_hostname']) . '\';';
$res = $this->dbi->query(
'SELECT * FROM `mysql`.`db`' . $user_host_condition
@ -5144,14 +5148,14 @@ class Privileges
if ($_error || (!empty($real_sql_query)
&& !$this->dbi->tryQuery($real_sql_query))
) {
$_REQUEST['createdb-1'] = $_REQUEST['createdb-2']
= $_REQUEST['createdb-3'] = null;
$_POST['createdb-1'] = $_POST['createdb-2']
= $_POST['createdb-3'] = null;
$message = Message::rawError($this->dbi->getError());
} else {
$message = Message::success(__('You have added a new user.'));
}
if (isset($_REQUEST['createdb-1'])) {
if (isset($_POST['createdb-1'])) {
// Create database with same name and grant all privileges
$q = 'CREATE DATABASE IF NOT EXISTS '
. Util::backquote(
@ -5182,7 +5186,7 @@ class Privileges
}
}
if (isset($_REQUEST['createdb-2'])) {
if (isset($_POST['createdb-2'])) {
// Grant all privileges on wildcard name (username\_%)
$q = 'GRANT ALL PRIVILEGES ON '
. Util::backquote(
@ -5198,7 +5202,7 @@ class Privileges
}
}
if (isset($_REQUEST['createdb-3'])) {
if (isset($_POST['createdb-3'])) {
// Grant all privileges on the specified database to the new user
$q = 'GRANT ALL PRIVILEGES ON '
. Util::backquote(
@ -5296,21 +5300,21 @@ class Privileges
// is supported by MySQL 5.5.7+
if (($serverType == 'MySQL' || $serverType == 'Percona Server')
&& $serverVersion >= 50507
&& isset($_REQUEST['authentication_plugin'])
&& isset($_POST['authentication_plugin'])
) {
$create_user_stmt .= ' IDENTIFIED WITH '
. $_REQUEST['authentication_plugin'];
. $_POST['authentication_plugin'];
}
// 'IDENTIFIED VIA auth_plugin'
// is supported by MariaDB 5.2+
if ($serverType == 'MariaDB'
&& $serverVersion >= 50200
&& isset($_REQUEST['authentication_plugin'])
&& isset($_POST['authentication_plugin'])
&& ! $isMariaDBPwdPluginActive
) {
$create_user_stmt .= ' IDENTIFIED VIA '
. $_REQUEST['authentication_plugin'];
. $_POST['authentication_plugin'];
}
$create_user_real = $create_user_stmt;
@ -5333,9 +5337,9 @@ class Privileges
$real_sql_query = $sql_query = $sql_query_stmt;
// Set the proper hashing method
if (isset($_REQUEST['authentication_plugin'])) {
if (isset($_POST['authentication_plugin'])) {
$this->setProperPasswordHashing(
$_REQUEST['authentication_plugin']
$_POST['authentication_plugin']
);
}

View File

@ -145,43 +145,44 @@ class Data
$links = [];
// variable or section name => (name => url)
$links['table'][__('Flush (close) all tables')] = $this->selfUrl
. Url::getCommon(
[
'flush' => 'TABLES'
]
);
$links['table'][__('Show open tables')]
= 'sql.php' . Url::getCommon(
[
'sql_query' => 'SHOW OPEN TABLES',
'goto' => $this->selfUrl,
]
);
$links['table'][__('Flush (close) all tables')] = [
'url' => $this->selfUrl,
'params' => Url::getCommon(['flush' => 'TABLES'], ''),
];
$links['table'][__('Show open tables')] = [
'url' => 'sql.php',
'params' => Url::getCommon([
'sql_query' => 'SHOW OPEN TABLES',
'goto' => $this->selfUrl,
], ''),
];
if ($GLOBALS['replication_info']['master']['status']) {
$links['repl'][__('Show slave hosts')]
= 'sql.php' . Url::getCommon(
[
'sql_query' => 'SHOW SLAVE HOSTS',
'goto' => $this->selfUrl,
]
);
$links['repl'][__('Show master status')] = '#replication_master';
$links['repl'][__('Show slave hosts')] = [
'url' => 'sql.php',
'params' => Url::getCommon([
'sql_query' => 'SHOW SLAVE HOSTS',
'goto' => $this->selfUrl,
], ''),
];
$links['repl'][__('Show master status')] = [
'url' => '#replication_master',
'params' => '',
];
}
if ($GLOBALS['replication_info']['slave']['status']) {
$links['repl'][__('Show slave status')] = '#replication_slave';
$links['repl'][__('Show slave status')] = [
'url' => '#replication_slave',
'params' => '',
];
}
$links['repl']['doc'] = 'replication';
$links['qcache'][__('Flush query cache')]
= $this->selfUrl
. Url::getCommon(
[
'flush' => 'QUERY CACHE'
]
);
$links['qcache'][__('Flush query cache')] = [
'url' => $this->selfUrl,
'params' => Url::getCommon(['flush' => 'QUERY CACHE'], ''),
];
$links['qcache']['doc'] = 'query_cache';
$links['threads']['doc'] = 'mysql_threads';
@ -192,16 +193,17 @@ class Data
$links['Slow_queries']['doc'] = 'slow_query_log';
$links['innodb'][__('Variables')]
= 'server_engines.php?' . Url::getCommon(['engine' => 'InnoDB']);
$links['innodb'][__('InnoDB Status')]
= 'server_engines.php'
. Url::getCommon(
[
'engine' => 'InnoDB',
'page' => 'Status'
]
);
$links['innodb'][__('Variables')] = [
'url' => 'server_engines.php',
'params' => Url::getCommon(['engine' => 'InnoDB'], ''),
];
$links['innodb'][__('InnoDB Status')] = [
'url' => 'server_engines.php',
'params' => Url::getCommon([
'engine' => 'InnoDB',
'page' => 'Status',
], ''),
];
$links['innodb']['doc'] = 'innodb';
return($links);

View File

@ -381,7 +381,7 @@ class Monitor
*/
public function getJsonForChartingData()
{
$ret = json_decode($_REQUEST['requiredData'], true);
$ret = json_decode($_POST['requiredData'], true);
$statusVars = [];
$serverVars = [];
$sysinfo = $cpuload = $memory = 0;
@ -658,7 +658,7 @@ class Monitor
public function getJsonForLogDataTypeGeneral($start, $end)
{
$limitTypes = '';
if (isset($_REQUEST['limitTypes']) && $_REQUEST['limitTypes']) {
if (isset($_POST['limitTypes']) && $_POST['limitTypes']) {
$limitTypes
= 'AND argument REGEXP \'^(INSERT|SELECT|UPDATE|DELETE)\' ';
}
@ -677,8 +677,8 @@ class Monitor
$insertTables = [];
$insertTablesFirst = -1;
$i = 0;
$removeVars = isset($_REQUEST['removeVariables'])
&& $_REQUEST['removeVariables'];
$removeVars = isset($_POST['removeVariables'])
&& $_POST['removeVariables'];
while ($row = $GLOBALS['dbi']->fetchAssoc($result)) {
preg_match('/^(\w+)\s/', $row['argument'], $match);
@ -779,15 +779,15 @@ class Monitor
*/
public function getJsonForLoggingVars()
{
if (isset($_REQUEST['varName']) && isset($_REQUEST['varValue'])) {
$value = $GLOBALS['dbi']->escapeString($_REQUEST['varValue']);
if (isset($_POST['varName']) && isset($_POST['varValue'])) {
$value = $GLOBALS['dbi']->escapeString($_POST['varValue']);
if (! is_numeric($value)) {
$value = "'" . $value . "'";
}
if (! preg_match("/[^a-zA-Z0-9_]+/", $_REQUEST['varName'])) {
if (! preg_match("/[^a-zA-Z0-9_]+/", $_POST['varName'])) {
$GLOBALS['dbi']->query(
'SET GLOBAL ' . $_REQUEST['varName'] . ' = ' . $value
'SET GLOBAL ' . $_POST['varName'] . ' = ' . $value
);
}
}
@ -810,8 +810,8 @@ class Monitor
{
$return = [];
if (strlen($_REQUEST['database']) > 0) {
$GLOBALS['dbi']->selectDb($_REQUEST['database']);
if (strlen($_POST['database']) > 0) {
$GLOBALS['dbi']->selectDb($_POST['database']);
}
if ($profiling = Util::profilingSupported()) {
@ -822,7 +822,7 @@ class Monitor
$query = preg_replace(
'/^(\s*SELECT)/i',
'\\1 SQL_NO_CACHE',
$_REQUEST['query']
$_POST['query']
);
$GLOBALS['dbi']->tryQuery($query);

View File

@ -60,7 +60,7 @@ class Processes
{
$url_params = [];
$show_full_sql = ! empty($_REQUEST['full']);
$show_full_sql = ! empty($_POST['full']);
if ($show_full_sql) {
$url_params['full'] = 1;
$full_text_link = 'server_status_processes.php' . Url::getCommon(
@ -118,19 +118,19 @@ class Processes
$sql_query = $show_full_sql
? 'SHOW FULL PROCESSLIST'
: 'SHOW PROCESSLIST';
if ((! empty($_REQUEST['order_by_field'])
&& ! empty($_REQUEST['sort_order']))
|| (! empty($_REQUEST['showExecuting']))
if ((! empty($_POST['order_by_field'])
&& ! empty($_POST['sort_order']))
|| (! empty($_POST['showExecuting']))
) {
$sql_query = 'SELECT * FROM `INFORMATION_SCHEMA`.`PROCESSLIST` ';
}
if (! empty($_REQUEST['showExecuting'])) {
if (! empty($_POST['showExecuting'])) {
$sql_query .= ' WHERE state != "" ';
}
if (!empty($_REQUEST['order_by_field']) && !empty($_REQUEST['sort_order'])) {
if (!empty($_POST['order_by_field']) && !empty($_POST['sort_order'])) {
$sql_query .= ' ORDER BY '
. Util::backquote($_REQUEST['order_by_field'])
. ' ' . $_REQUEST['sort_order'];
. Util::backquote($_POST['order_by_field'])
. ' ' . $_POST['sort_order'];
}
$result = $GLOBALS['dbi']->query($sql_query);
@ -142,15 +142,15 @@ class Processes
$retval .= '<tr>';
$retval .= '<th>' . __('Processes') . '</th>';
foreach ($sortable_columns as $column) {
$is_sorted = ! empty($_REQUEST['order_by_field'])
&& ! empty($_REQUEST['sort_order'])
&& ($_REQUEST['order_by_field'] == $column['order_by_field']);
$is_sorted = ! empty($_POST['order_by_field'])
&& ! empty($_POST['sort_order'])
&& ($_POST['order_by_field'] == $column['order_by_field']);
$column['sort_order'] = 'ASC';
if ($is_sorted && $_REQUEST['sort_order'] === 'ASC') {
if ($is_sorted && $_POST['sort_order'] === 'ASC') {
$column['sort_order'] = 'DESC';
}
if (isset($_REQUEST['showExecuting'])) {
if (isset($_POST['showExecuting'])) {
$column['showExecuting'] = 'on';
}
@ -163,7 +163,7 @@ class Processes
if ($is_sorted) {
$asc_display_style = 'inline';
$desc_display_style = 'none';
if ($_REQUEST['sort_order'] === 'DESC') {
if ($_POST['sort_order'] === 'DESC') {
$desc_display_style = 'inline';
$asc_display_style = 'none';
}
@ -216,23 +216,23 @@ class Processes
public static function getHtmlForProcessListFilter()
{
$showExecuting = '';
if (! empty($_REQUEST['showExecuting'])) {
if (! empty($_POST['showExecuting'])) {
$showExecuting = ' checked="checked"';
}
$url_params = [
'ajax_request' => true,
'full' => (isset($_REQUEST['full']) ? $_REQUEST['full'] : ''),
'column_name' => (isset($_REQUEST['column_name']) ? $_REQUEST['column_name'] : ''),
'full' => (isset($_POST['full']) ? $_POST['full'] : ''),
'column_name' => (isset($_POST['column_name']) ? $_POST['column_name'] : ''),
'order_by_field'
=> (isset($_REQUEST['order_by_field']) ? $_REQUEST['order_by_field'] : ''),
'sort_order' => (isset($_REQUEST['sort_order']) ? $_REQUEST['sort_order'] : ''),
=> (isset($_POST['order_by_field']) ? $_POST['order_by_field'] : ''),
'sort_order' => (isset($_POST['sort_order']) ? $_POST['sort_order'] : ''),
];
$retval = '';
$retval .= '<fieldset id="tableFilter">';
$retval .= '<legend>' . __('Filters') . '</legend>';
$retval .= '<form action="server_status_processes.php">';
$retval .= '<form action="server_status_processes.php" method="post">';
$retval .= Url::getHiddenInputs($url_params);
$retval .= '<input type="submit" value="' . __('Refresh') . '" />';
$retval .= '<div class="formelement">';
@ -260,8 +260,8 @@ class Processes
{
// Array keys need to modify due to the way it has used
// to display column values
if ((! empty($_REQUEST['order_by_field']) && ! empty($_REQUEST['sort_order']))
|| (! empty($_REQUEST['showExecuting']))
if ((! empty($_POST['order_by_field']) && ! empty($_POST['sort_order']))
|| (! empty($_POST['showExecuting']))
) {
foreach (array_keys($process) as $key) {
$new_key = ucfirst(mb_strtolower($key));
@ -272,14 +272,9 @@ class Processes
}
}
$url_params = [
'kill' => $process['Id'],
'ajax_request' => true
];
$kill_process = 'server_status_processes.php' . Url::getCommon($url_params);
$retval = '<tr>';
$retval .= '<td><a class="ajax kill_process" href="' . $kill_process . '">'
$retval .= '<td><a class="ajax kill_process" href="server_status_processes.php"'
. ' data-post="' . Url::getCommon(['kill' => $process['Id']], '') . '">'
. __('Kill') . '</a></td>';
$retval .= '<td class="value">' . $process['Id'] . '</td>';
$retval .= '<td>' . htmlspecialchars($process['User']) . '</td>';

View File

@ -32,23 +32,23 @@ class Variables
public static function getHtmlForFilter(Data $serverStatusData)
{
$filterAlert = '';
if (! empty($_REQUEST['filterAlert'])) {
if (! empty($_POST['filterAlert'])) {
$filterAlert = ' checked="checked"';
}
$filterText = '';
if (! empty($_REQUEST['filterText'])) {
$filterText = htmlspecialchars($_REQUEST['filterText']);
if (! empty($_POST['filterText'])) {
$filterText = htmlspecialchars($_POST['filterText']);
}
$dontFormat = '';
if (! empty($_REQUEST['dontFormat'])) {
if (! empty($_POST['dontFormat'])) {
$dontFormat = ' checked="checked"';
}
$retval = '';
$retval .= '<fieldset id="tableFilter">';
$retval .= '<legend>' . __('Filters') . '</legend>';
$retval .= '<form action="server_status_variables.php'
. Url::getCommon() . '">';
$retval .= '<form action="server_status_variables.php" method="post">';
$retval .= Url::getHiddenInputs();
$retval .= '<input type="submit" value="' . __('Refresh') . '" />';
$retval .= '<div class="formelement">';
$retval .= '<label for="filterText">' . __('Containing the word:') . '</label>';
@ -68,8 +68,8 @@ class Variables
foreach ($serverStatusData->sections as $section_id => $section_name) {
if (isset($serverStatusData->sectionUsed[$section_id])) {
if (! empty($_REQUEST['filterCategory'])
&& $_REQUEST['filterCategory'] == $section_id
if (! empty($_POST['filterCategory'])
&& $_POST['filterCategory'] == $section_id
) {
$selected = ' selected="selected"';
} else {
@ -115,7 +115,8 @@ class Variables
if ('doc' == $link_name) {
$retval .= Util::showMySQLDocu($link_url);
} else {
$retval .= '<a href="' . $link_url . '">' . $link_name . '</a>';
$retval .= '<a href="' . $link_url['url'] . '" data-post="' . $link_url['params'] . '">'
. $link_name . '</a>';
}
$i++;
}
@ -307,7 +308,8 @@ class Variables
if ('doc' == $link_name) {
$retval .= Util::showMySQLDocu($link_url);
} else {
$retval .= ' <a href="' . $link_url . '">' . $link_name . '</a>';
$retval .= ' <a href="' . $link_url['url'] . '" data-post="' . $link_url['params'] . '">'
. $link_name . '</a>';
}
}
unset($link_url, $link_name);

View File

@ -112,31 +112,34 @@ class UserGroups
$html_output .= '<td>' . self::getAllowedTabNames($tabs, 'table') . '</td>';
$html_output .= '<td>';
$html_output .= '<a class="" href="server_user_groups.php'
$html_output .= '<a class="" href="server_user_groups.php" data-post="'
. Url::getCommon(
[
'viewUsers' => 1, 'userGroup' => $groupName
]
],
''
)
. '">'
. Util::getIcon('b_usrlist', __('View users'))
. '</a>';
$html_output .= '&nbsp;&nbsp;';
$html_output .= '<a class="" href="server_user_groups.php'
$html_output .= '<a class="" href="server_user_groups.php" data-post="'
. Url::getCommon(
[
'editUserGroup' => 1, 'userGroup' => $groupName
]
],
''
)
. '">'
. Util::getIcon('b_edit', __('Edit')) . '</a>';
$html_output .= '&nbsp;&nbsp;';
$html_output .= '<a class="deleteUserGroup ajax"'
. ' href="server_user_groups.php'
. ' href="server_user_groups.php" data-post="'
. Url::getCommon(
[
'deleteUserGroup' => 1, 'userGroup' => $groupName
]
],
''
)
. '">'
. Util::getIcon('b_drop', __('Delete')) . '</a>';
@ -372,7 +375,7 @@ class UserGroups
$sql_query .= ", ";
}
$tabName = $tabGroupName . '_' . $tab;
$allowed = isset($_REQUEST[$tabName]) && $_REQUEST[$tabName] == 'Y';
$allowed = isset($_POST[$tabName]) && $_POST[$tabName] == 'Y';
$sql_query .= "('" . $GLOBALS['dbi']->escapeString($userGroup) . "', '" . $tabName . "', '"
. ($allowed ? "Y" : "N") . "')";
$first = false;

View File

@ -241,10 +241,10 @@ class Sql
];
$dropdown = '<span class="curr_value">'
. htmlspecialchars($_REQUEST['curr_value'])
. htmlspecialchars($_POST['curr_value'])
. '</span>'
. '<a href="browse_foreigners.php'
. Url::getCommon($_url_params) . '"'
. '<a href="browse_foreigners.php" data-post="'
. Url::getCommon($_url_params, '') . '"'
. 'class="ajax browse_foreign" ' . '>'
. __('Browse foreign values')
. '</a>';
@ -496,9 +496,9 @@ EOT;
$values = $this->getValuesForColumn($db, $table, $column);
$dropdown = '';
$full_values =
isset($_REQUEST['get_full_values']) ? $_REQUEST['get_full_values'] : false;
isset($_POST['get_full_values']) ? $_POST['get_full_values'] : false;
$where_clause =
isset($_REQUEST['where_clause']) ? $_REQUEST['where_clause'] : null;
isset($_POST['where_clause']) ? $_POST['where_clause'] : null;
// If the $curr_value was truncated, we should
// fetch the correct full values from the table
@ -783,7 +783,7 @@ EOT;
*/
private function setColumnProperty($pmatable, $request_index)
{
$property_value = array_map('intval', explode(',', $_REQUEST[$request_index]));
$property_value = array_map('intval', explode(',', $_POST[$request_index]));
switch ($request_index) {
case 'col_order':
$property_to_set = Table::PROP_COLUMN_ORDER;
@ -797,7 +797,7 @@ EOT;
$retval = $pmatable->setUiProp(
$property_to_set,
$property_value,
$_REQUEST['table_create_time']
$_POST['table_create_time']
);
if (gettype($retval) != 'boolean') {
$response = Response::getInstance();
@ -823,12 +823,12 @@ EOT;
$retval = false;
// set column order
if (isset($_REQUEST['col_order'])) {
if (isset($_POST['col_order'])) {
$retval = $this->setColumnProperty($pmatable, 'col_order');
}
// set column visibility
if ($retval === true && isset($_REQUEST['col_visib'])) {
if ($retval === true && isset($_POST['col_visib'])) {
$retval = $this->setColumnProperty($pmatable, 'col_visib');
}
@ -905,14 +905,14 @@ EOT;
*/
public function getRelationalValues($db, $table)
{
$column = $_REQUEST['column'];
$column = $_POST['column'];
if ($_SESSION['tmpval']['relational_display'] == 'D'
&& isset($_REQUEST['relation_key_or_display_column'])
&& $_REQUEST['relation_key_or_display_column']
&& isset($_POST['relation_key_or_display_column'])
&& $_POST['relation_key_or_display_column']
) {
$curr_value = $_REQUEST['relation_key_or_display_column'];
$curr_value = $_POST['relation_key_or_display_column'];
} else {
$curr_value = $_REQUEST['curr_value'];
$curr_value = $_POST['curr_value'];
}
$dropdown = $this->getHtmlForRelationalColumnDropdown(
$db,
@ -936,8 +936,8 @@ EOT;
*/
public function getEnumOrSetValues($db, $table, $columnType)
{
$column = $_REQUEST['column'];
$curr_value = $_REQUEST['curr_value'];
$column = $_POST['column'];
$curr_value = $_POST['curr_value'];
$response = Response::getInstance();
if ($columnType == "enum") {
$dropdown = $this->getHtmlForEnumColumnDropdown(
@ -1374,11 +1374,11 @@ EOT;
$this->cleanupRelations(
isset($db) ? $db : '',
isset($table) ? $table : '',
isset($_REQUEST['dropped_column']) ? $_REQUEST['dropped_column'] : null,
isset($_REQUEST['purge']) ? $_REQUEST['purge'] : null
isset($_POST['dropped_column']) ? $_POST['dropped_column'] : null,
isset($_POST['purge']) ? $_POST['purge'] : null
);
if (isset($_REQUEST['dropped_column'])
if (isset($_POST['dropped_column'])
&& strlen($db) > 0
&& strlen($table) > 0
) {
@ -1496,7 +1496,7 @@ EOT;
}
// In case of ROLLBACK, notify the user.
if (isset($_REQUEST['rollback_query'])) {
if (isset($_POST['rollback_query'])) {
$message->addText(__('[ROLLBACK occurred.]'));
}
@ -1740,9 +1740,9 @@ EOT;
array $analyzed_sql_results,
$is_limited_display = false
) {
$printview = isset($_REQUEST['printview']) && $_REQUEST['printview'] == '1' ? '1' : null;
$printview = isset($_POST['printview']) && $_POST['printview'] == '1' ? '1' : null;
$table_html = '';
$browse_dist = ! empty($_REQUEST['is_browse_distinct']);
$browse_dist = ! empty($_POST['is_browse_distinct']);
if ($analyzed_sql_results['is_procedure']) {
do {
@ -2009,7 +2009,7 @@ EOT;
global $showtable, $url_query;
// If we are retrieving the full value of a truncated field or the original
// value of a transformed field, show it here
if (isset($_REQUEST['grid_edit']) && $_REQUEST['grid_edit'] == true) {
if (isset($_POST['grid_edit']) && $_POST['grid_edit'] == true) {
$this->sendResponseForGridEdit($result);
// script has exited at this point
}
@ -2090,7 +2090,7 @@ EOT;
'pview_lnk' => '1'
];
}
if (isset($_REQUEST['printview']) && $_REQUEST['printview'] == '1') {
if (isset($_POST['printview']) && $_POST['printview'] == '1') {
$displayParts = [
'edit_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE,
'del_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE,
@ -2102,7 +2102,7 @@ EOT;
];
}
if (isset($_REQUEST['table_maintenance'])) {
if (isset($_POST['table_maintenance'])) {
$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');
$table_maintenance_html = '';
@ -2132,7 +2132,7 @@ EOT;
}
}
if (!isset($_REQUEST['printview']) || $_REQUEST['printview'] != '1') {
if (!isset($_POST['printview']) || $_POST['printview'] != '1') {
$scripts->addFile('makegrid.js');
$scripts->addFile('sql.js');
unset($GLOBALS['message']);
@ -2357,7 +2357,7 @@ EOT;
if (! empty($analyzed_sql_results)
&& $this->isRememberSortingOrder($analyzed_sql_results)
&& empty($analyzed_sql_results['union'])
&& ! isset($_REQUEST['sort_by_key'])
&& ! isset($_POST['sort_by_key'])
) {
if (! isset($_SESSION['sql_from_query_box'])) {
$this->handleSortOrder($db, $table, $analyzed_sql_results, $sql_query);

View File

@ -1063,8 +1063,8 @@ class Table
// Phase 1: Dropping existent element of the same name (if exists
// and required).
if (isset($_REQUEST['drop_if_exists'])
&& $_REQUEST['drop_if_exists'] == 'true'
if (isset($_POST['drop_if_exists'])
&& $_POST['drop_if_exists'] == 'true'
) {
/**
@ -1919,7 +1919,7 @@ class Table
return false;
}
if (!isset($_REQUEST['discard_remembered_sort'])) {
if (!isset($_POST['discard_remembered_sort'])) {
// check if the column name exists in this table
$tmp = explode(' ', $this->uiprefs[$property]);
$colname = $tmp[0];
@ -2125,13 +2125,13 @@ class Table
);
// Drops the old index
if (! empty($_REQUEST['old_index'])) {
if ($_REQUEST['old_index'] == 'PRIMARY') {
if (! empty($_POST['old_index'])) {
if ($_POST['old_index'] == 'PRIMARY') {
$sql_query .= ' DROP PRIMARY KEY,';
} else {
$sql_query .= sprintf(
' DROP INDEX %s,',
Util::backquote($_REQUEST['old_index'])
Util::backquote($_POST['old_index'])
);
}
} // end if
@ -2428,9 +2428,9 @@ class Table
|| $existrel_foreign[$master_field_md5]['ref_table_name'] != $foreign_table
|| $existrel_foreign[$master_field_md5]['ref_index_list'] != $foreign_field
|| $existrel_foreign[$master_field_md5]['index_list'] != $master_field
|| $_REQUEST['constraint_name'][$master_field_md5] != $constraint_name
|| ($_REQUEST['on_delete'][$master_field_md5] != $on_delete)
|| ($_REQUEST['on_update'][$master_field_md5] != $on_update)
|| $_POST['constraint_name'][$master_field_md5] != $constraint_name
|| ($_POST['on_delete'][$master_field_md5] != $on_delete)
|| ($_POST['on_update'][$master_field_md5] != $on_update)
) {
// another foreign key is already defined for this field
// or an option has been changed for ON DELETE or ON UPDATE
@ -2454,7 +2454,7 @@ class Table
)
. ';';
if (! isset($_REQUEST['preview_sql'])) {
if (! isset($_POST['preview_sql'])) {
$display_query .= $drop_query . "\n";
$this->_dbi->tryQuery($drop_query);
$tmp_error_drop = $this->_dbi->getError();
@ -2485,12 +2485,12 @@ class Table
$foreign_db,
$foreign_table,
$foreign_field,
$_REQUEST['constraint_name'][$master_field_md5],
$options_array[$_REQUEST['on_delete'][$master_field_md5]],
$options_array[$_REQUEST['on_update'][$master_field_md5]]
$_POST['constraint_name'][$master_field_md5],
$options_array[$_POST['on_delete'][$master_field_md5]],
$options_array[$_POST['on_update'][$master_field_md5]]
);
if (! isset($_REQUEST['preview_sql'])) {
if (! isset($_POST['preview_sql'])) {
$display_query .= $create_query . "\n";
$this->_dbi->tryQuery($create_query);
$tmp_error_create = $this->_dbi->getError();
@ -2540,7 +2540,7 @@ class Table
$options_array[$existrel_foreign[$master_field_md5]['on_delete']],
$options_array[$existrel_foreign[$master_field_md5]['on_update']]
);
if (! isset($_REQUEST['preview_sql'])) {
if (! isset($_POST['preview_sql'])) {
$display_query .= $sql_query_recreate . "\n";
$this->_dbi->tryQuery($sql_query_recreate);
} else {

View File

@ -146,10 +146,10 @@ class Tracking
$sql_query = " SELECT * FROM " .
Util::backquote($cfgRelation['db']) . "." .
Util::backquote($cfgRelation['tracking']) .
" WHERE db_name = '" . $GLOBALS['dbi']->escapeString($_REQUEST['db']) .
" WHERE db_name = '" . $GLOBALS['dbi']->escapeString($GLOBALS['db']) .
"' " .
" AND table_name = '" .
$GLOBALS['dbi']->escapeString($_REQUEST['table']) . "' " .
$GLOBALS['dbi']->escapeString($GLOBALS['table']) . "' " .
" ORDER BY version DESC ";
return $relation->queryAsControlUser($sql_query);
@ -204,7 +204,7 @@ class Tracking
'table' => $GLOBALS['table'],
'selectable_tables_num_rows' => $selectableTablesNumRows,
'selectable_tables_entries' => $selectableTablesEntries,
'selected_table' => isset($_REQUEST['table']) ? $_REQUEST['table'] : null,
'selected_table' => isset($_POST['table']) ? $_POST['table'] : null,
'last_version' => $lastVersion,
'versions' => $versions,
'type' => $type,
@ -364,11 +364,11 @@ class Tracking
. __('Structure and data') . '</option>'
. '</select>';
$str2 = '<input type="text" name="date_from" value="'
. htmlspecialchars($_REQUEST['date_from']) . '" size="19" />';
. htmlspecialchars($_POST['date_from']) . '" size="19" />';
$str3 = '<input type="text" name="date_to" value="'
. htmlspecialchars($_REQUEST['date_to']) . '" size="19" />';
. htmlspecialchars($_POST['date_to']) . '" size="19" />';
$str4 = '<input type="text" name="users" value="'
. htmlspecialchars($_REQUEST['users']) . '" />';
. htmlspecialchars($_POST['users']) . '" />';
$str5 = '<input type="hidden" name="list_report" value="1" />'
. '<input type="submit" value="' . __('Go') . '" />';
return [$str1, $str2, $str3, $str4, $str5];
@ -412,14 +412,11 @@ class Tracking
) {
$ddlog_count = 0;
$html = '<form method="post" action="tbl_tracking.php'
. Url::getCommon(
$url_params + [
'report' => 'true', 'version' => $_REQUEST['version']
]
)
. '">';
$html .= Url::getHiddenInputs();
$html = '<form method="post" action="tbl_tracking.php">';
$html .= Url::getHiddenInputs($url_params + [
'report' => 'true',
'version' => $_POST['version'],
]);
$html .= sprintf(
__('Show %1$s with dates from %2$s to %3$s by user %4$s %5$s'),
@ -481,14 +478,12 @@ class Tracking
$str4,
$str5
) {
$html = '<form method="post" action="tbl_tracking.php'
. Url::getCommon(
$url_params + [
'report' => 'true', 'version' => $_REQUEST['version']
]
)
. '">';
$html .= Url::getHiddenInputs();
$html = '<form method="post" action="tbl_tracking.php">';
$html .= Url::getHiddenInputs($url_params + [
'report' => 'true',
'version' => $_POST['version'],
]);
$html .= sprintf(
__('Show %1$s with dates from %2$s to %3$s by user %4$s %5$s'),
$str1,
@ -499,21 +494,16 @@ class Tracking
);
$html .= '</form>';
$html .= '<form class="disableAjax" method="post" action="tbl_tracking.php'
. Url::getCommon(
$url_params
+ ['report' => 'true', 'version' => $_REQUEST['version']]
)
. '">';
$html .= Url::getHiddenInputs();
$html .= '<input type="hidden" name="logtype" value="'
. htmlspecialchars($_REQUEST['logtype']) . '" />';
$html .= '<input type="hidden" name="date_from" value="'
. htmlspecialchars($_REQUEST['date_from']) . '" />';
$html .= '<input type="hidden" name="date_to" value="'
. htmlspecialchars($_REQUEST['date_to']) . '" />';
$html .= '<input type="hidden" name="users" value="'
. htmlspecialchars($_REQUEST['users']) . '" />';
$html .= '<form class="disableAjax" method="post" action="tbl_tracking.php">';
$html .= Url::getHiddenInputs($url_params + [
'report' => 'true',
'version' => $_POST['version'],
'logtype' => $_POST['logtype'],
'date_from' => $_POST['date_from'],
'date_to' => $_POST['date_to'],
'users' => $_POST['users'],
'report_export' => 'true',
]);
$str_export1 = '<select name="export_type">'
. '<option value="sqldumpfile">' . __('SQL dump (file download)')
@ -525,8 +515,7 @@ class Tracking
)
. '\')">' . __('SQL execution') . '</option>' . '</select>';
$str_export2 = '<input type="hidden" name="report_export" value="1" />'
. '<input type="submit" value="' . __('Go') . '" />';
$str_export2 = '<input type="submit" value="' . __('Go') . '" />';
$html .= "<br/>" . sprintf(__('Export as %s'), $str_export1)
. $str_export2 . "<br/>";
@ -650,9 +639,9 @@ class Tracking
$deleteParam = 'delete_' . $whichLog;
$entry['url_params'] = Url::getCommon($urlParams + [
'report' => 'true',
'version' => $_REQUEST['version'],
'version' => $_POST['version'],
$deleteParam => ($lineNumber - $offset),
]);
], '');
$entry['line_number'] = $lineNumber;
$entries[] = $entry;
}
@ -682,9 +671,9 @@ class Tracking
. ' [<a href="tbl_tracking.php' . $url_query . '">' . __('Close')
. '</a>]</h3>';
$data = Tracker::getTrackedData(
$_REQUEST['db'],
$_REQUEST['table'],
$_REQUEST['version']
$_POST['db'],
$_POST['table'],
$_POST['version']
);
// Get first DROP TABLE/VIEW and CREATE TABLE/VIEW statements
@ -699,7 +688,7 @@ class Tracking
$html .= Util::getMessage(
sprintf(
__('Version %s snapshot (SQL code)'),
htmlspecialchars($_REQUEST['version'])
htmlspecialchars($_POST['version'])
),
$drop_create_statements
);
@ -759,7 +748,7 @@ class Tracking
public function deleteTrackingReportRows(array &$data)
{
$html = '';
if (isset($_REQUEST['delete_ddlog'])) {
if (isset($_POST['delete_ddlog'])) {
// Delete ddlog row data
$html .= $this->deleteFromTrackingReportLog(
$data,
@ -769,7 +758,7 @@ class Tracking
);
}
if (isset($_REQUEST['delete_dmlog'])) {
if (isset($_POST['delete_dmlog'])) {
// Delete dmlog row data
$html .= $this->deleteFromTrackingReportLog(
$data,
@ -794,16 +783,16 @@ class Tracking
public function deleteFromTrackingReportLog(array &$data, $which_log, $type, $message)
{
$html = '';
$delete_id = $_REQUEST['delete_' . $which_log];
$delete_id = $_POST['delete_' . $which_log];
// Only in case of valid id
if ($delete_id == (int)$delete_id) {
unset($data[$which_log][$delete_id]);
$successfullyDeleted = Tracker::changeTrackingData(
$_REQUEST['db'],
$_REQUEST['table'],
$_REQUEST['version'],
$GLOBALS['db'],
$GLOBALS['table'],
$_POST['version'],
$type,
$data[$which_log]
);
@ -889,7 +878,7 @@ class Tracking
ini_set('url_rewriter.tags', '');
// Replace all multiple whitespaces by a single space
$table = htmlspecialchars(preg_replace('/\s+/', ' ', $_REQUEST['table']));
$table = htmlspecialchars(preg_replace('/\s+/', ' ', $_POST['table']));
$dump = "# " . sprintf(
__('Tracking report for table `%s`'),
$table
@ -930,14 +919,14 @@ class Tracking
$status = Tracker::$method(
$GLOBALS['db'],
$GLOBALS['table'],
$_REQUEST['version']
$_POST['version']
);
if ($status) {
$msg = Message::success(
sprintf(
$message,
htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table']),
htmlspecialchars($_REQUEST['version'])
htmlspecialchars($_POST['version'])
)
);
$html .= $msg->getDisplay();
@ -957,43 +946,43 @@ class Tracking
// a key is absent from the request if it has been removed from
// tracking_default_statements in the config
if (isset($_REQUEST['alter_table']) && $_REQUEST['alter_table'] == true) {
if (isset($_POST['alter_table']) && $_POST['alter_table'] == true) {
$tracking_set .= 'ALTER TABLE,';
}
if (isset($_REQUEST['rename_table']) && $_REQUEST['rename_table'] == true) {
if (isset($_POST['rename_table']) && $_POST['rename_table'] == true) {
$tracking_set .= 'RENAME TABLE,';
}
if (isset($_REQUEST['create_table']) && $_REQUEST['create_table'] == true) {
if (isset($_POST['create_table']) && $_POST['create_table'] == true) {
$tracking_set .= 'CREATE TABLE,';
}
if (isset($_REQUEST['drop_table']) && $_REQUEST['drop_table'] == true) {
if (isset($_POST['drop_table']) && $_POST['drop_table'] == true) {
$tracking_set .= 'DROP TABLE,';
}
if (isset($_REQUEST['alter_view']) && $_REQUEST['alter_view'] == true) {
if (isset($_POST['alter_view']) && $_POST['alter_view'] == true) {
$tracking_set .= 'ALTER VIEW,';
}
if (isset($_REQUEST['create_view']) && $_REQUEST['create_view'] == true) {
if (isset($_POST['create_view']) && $_POST['create_view'] == true) {
$tracking_set .= 'CREATE VIEW,';
}
if (isset($_REQUEST['drop_view']) && $_REQUEST['drop_view'] == true) {
if (isset($_POST['drop_view']) && $_POST['drop_view'] == true) {
$tracking_set .= 'DROP VIEW,';
}
if (isset($_REQUEST['create_index']) && $_REQUEST['create_index'] == true) {
if (isset($_POST['create_index']) && $_POST['create_index'] == true) {
$tracking_set .= 'CREATE INDEX,';
}
if (isset($_REQUEST['drop_index']) && $_REQUEST['drop_index'] == true) {
if (isset($_POST['drop_index']) && $_POST['drop_index'] == true) {
$tracking_set .= 'DROP INDEX,';
}
if (isset($_REQUEST['insert']) && $_REQUEST['insert'] == true) {
if (isset($_POST['insert']) && $_POST['insert'] == true) {
$tracking_set .= 'INSERT,';
}
if (isset($_REQUEST['update']) && $_REQUEST['update'] == true) {
if (isset($_POST['update']) && $_POST['update'] == true) {
$tracking_set .= 'UPDATE,';
}
if (isset($_REQUEST['delete']) && $_REQUEST['delete'] == true) {
if (isset($_POST['delete']) && $_POST['delete'] == true) {
$tracking_set .= 'DELETE,';
}
if (isset($_REQUEST['truncate']) && $_REQUEST['truncate'] == true) {
if (isset($_POST['truncate']) && $_POST['truncate'] == true) {
$tracking_set .= 'TRUNCATE,';
}
$tracking_set = rtrim($tracking_set, ',');
@ -1043,7 +1032,7 @@ class Tracking
$versionCreated = Tracker::createVersion(
$GLOBALS['db'],
$GLOBALS['table'],
$_REQUEST['version'],
$_POST['version'],
$tracking_set,
$GLOBALS['dbi']->getTable($GLOBALS['db'], $GLOBALS['table'])->isView()
);
@ -1051,7 +1040,7 @@ class Tracking
$msg = Message::success(
sprintf(
__('Version %1$s was created, tracking for %2$s is active.'),
htmlspecialchars($_REQUEST['version']),
htmlspecialchars($_POST['version']),
htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table'])
)
);
@ -1076,7 +1065,7 @@ class Tracking
Tracker::createVersion(
$GLOBALS['db'],
$selected_table,
$_REQUEST['version'],
$_POST['version'],
$tracking_set,
$GLOBALS['dbi']->getTable($GLOBALS['db'], $selected_table)->isView()
);
@ -1097,8 +1086,8 @@ class Tracking
{
$entries = [];
// Filtering data definition statements
if ($_REQUEST['logtype'] == 'schema'
|| $_REQUEST['logtype'] == 'schema_and_data'
if ($_POST['logtype'] == 'schema'
|| $_POST['logtype'] == 'schema_and_data'
) {
$entries = array_merge(
$entries,
@ -1112,8 +1101,8 @@ class Tracking
}
// Filtering data manipulation statements
if ($_REQUEST['logtype'] == 'data'
|| $_REQUEST['logtype'] == 'schema_and_data'
if ($_POST['logtype'] == 'data'
|| $_POST['logtype'] == 'schema_and_data'
) {
$entries = array_merge(
$entries,
@ -1170,7 +1159,6 @@ class Tracking
* Get HTML for tracked and untracked tables
*
* @param string $db current database
* @param string $requestDb $_REQUEST['db']
* @param string $urlQuery url query string
* @param string $pmaThemeImage path to theme's image folder
* @param string $textDir text direction
@ -1179,7 +1167,6 @@ class Tracking
*/
public function getHtmlForDbTrackingTables(
string $db,
string $requestDb,
string $urlQuery,
string $pmaThemeImage,
string $textDir
@ -1191,7 +1178,7 @@ class Tracking
$allTablesQuery = ' SELECT table_name, MAX(version) as version FROM ' .
Util::backquote($cfgRelation['db']) . '.' .
Util::backquote($cfgRelation['tracking']) .
' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($requestDb) .
' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) .
'\' ' .
' GROUP BY table_name' .
' ORDER BY table_name ASC';
@ -1210,7 +1197,7 @@ class Tracking
Util::backquote($cfgRelation['db']) . '.' .
Util::backquote($cfgRelation['tracking']) .
' WHERE `db_name` = \''
. $GLOBALS['dbi']->escapeString($requestDb)
. $GLOBALS['dbi']->escapeString($db)
. '\' AND `table_name` = \''
. $GLOBALS['dbi']->escapeString($tableName)
. '\' AND `version` = \'' . $versionNumber . '\'';

View File

@ -183,16 +183,17 @@ class Transformations
*
* @param string $file transformation file
*
* @return String the description of the transformation
* @return string the description of the transformation
*/
public function getDescription($file)
{
$include_file = 'libraries/classes/Plugins/Transformations/' . $file;
/* @var $class_name PhpMyAdmin\Plugins\TransformationsInterface */
/* @var $class_name \PhpMyAdmin\Plugins\TransformationsInterface */
$class_name = $this->getClassName($include_file);
// include and instantiate the class
include_once $include_file;
return $class_name::getInfo();
if (class_exists($class_name)) {
return $class_name::getInfo();
}
return '';
}
/**
@ -200,16 +201,17 @@ class Transformations
*
* @param string $file transformation file
*
* @return String the name of the transformation
* @return string the name of the transformation
*/
public function getName($file)
{
$include_file = 'libraries/classes/Plugins/Transformations/' . $file;
/* @var $class_name PhpMyAdmin\Plugins\TransformationsInterface */
/* @var $class_name \PhpMyAdmin\Plugins\TransformationsInterface */
$class_name = $this->getClassName($include_file);
// include and instantiate the class
include_once $include_file;
return $class_name::getName();
if (class_exists($class_name)) {
return $class_name::getName();
}
return '';
}
/**

View File

@ -78,16 +78,16 @@ class UserPassword
$error = false;
$message = Message::success(__('The profile has been updated.'));
if (($_REQUEST['nopass'] != '1')) {
if (strlen($_REQUEST['pma_pw']) === 0 || strlen($_REQUEST['pma_pw2']) === 0) {
if (($_POST['nopass'] != '1')) {
if (strlen($_POST['pma_pw']) === 0 || strlen($_POST['pma_pw2']) === 0) {
$message = Message::error(__('The password is empty!'));
$error = true;
} elseif ($_REQUEST['pma_pw'] !== $_REQUEST['pma_pw2']) {
} elseif ($_POST['pma_pw'] !== $_POST['pma_pw2']) {
$message = Message::error(
__('The passwords aren\'t the same!')
);
$error = true;
} elseif (strlen($_REQUEST['pma_pw']) > 256) {
} elseif (strlen($_POST['pma_pw']) > 256) {
$message = Message::error(__('Password is too long!'));
$error = true;
}
@ -115,10 +115,10 @@ class UserPassword
$serverType = Util::getServerType();
$serverVersion = $GLOBALS['dbi']->getVersion();
if (isset($_REQUEST['authentication_plugin'])
&& ! empty($_REQUEST['authentication_plugin'])
if (isset($_POST['authentication_plugin'])
&& ! empty($_POST['authentication_plugin'])
) {
$orig_auth_plugin = $_REQUEST['authentication_plugin'];
$orig_auth_plugin = $_POST['authentication_plugin'];
} else {
$orig_auth_plugin = $this->serverPrivileges->getCurrentAuthenticationPlugin(
'change',
@ -175,7 +175,7 @@ class UserPassword
private function changePassHashingFunction()
{
if (Core::isValid(
$_REQUEST['authentication_plugin'],
$_POST['authentication_plugin'],
'identical',
'mysql_old_password'
)) {

View File

@ -38,8 +38,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];
}
}
$response = Response::getInstance();
@ -57,16 +57,16 @@ $template = new Template();
*/
if (! empty($submit_mult)
&& $submit_mult != __('With selected:')
&& (! empty($_REQUEST['selected_dbs'])
&& (! empty($_POST['selected_dbs'])
|| ! empty($_POST['selected_tbl'])
|| ! empty($selected_fld)
|| ! empty($_REQUEST['rows_to_delete']))
|| ! empty($_POST['rows_to_delete']))
) {
define('PMA_SUBMIT_MULT', 1);
if (! empty($_REQUEST['selected_dbs'])) {
if (! empty($_POST['selected_dbs'])) {
// coming from server database view - do something with
// selected databases
$selected = $_REQUEST['selected_dbs'];
$selected = $_POST['selected_dbs'];
$query_type = 'drop_db';
} elseif (! empty($_POST['selected_tbl'])) {
// coming from database structure view - do something with

View File

@ -23,7 +23,7 @@ $server_master_replication = $GLOBALS['dbi']->fetchResult('SHOW MASTER STATUS');
/**
* set selected master server
*/
if (! empty($_REQUEST['master_connection'])) {
if (! empty($_POST['master_connection'])) {
/**
* check for multi-master replication functionality
*/
@ -34,10 +34,10 @@ if (! empty($_REQUEST['master_connection'])) {
$GLOBALS['dbi']->query(
"SET @@default_master_connection = '"
. $GLOBALS['dbi']->escapeString(
$_REQUEST['master_connection']
$_POST['master_connection']
) . "'"
);
$GLOBALS['url_params']['master_connection'] = $_REQUEST['master_connection'];
$GLOBALS['url_params']['master_connection'] = $_POST['master_connection'];
}
}

View File

@ -64,10 +64,10 @@ if ($action == 'tbl_create.php') {
$form_params = array_merge(
$form_params,
[
'field_where' => Util::getValueByKey($_REQUEST, 'field_where')]
'field_where' => Util::getValueByKey($_POST, 'field_where')]
);
if (isset($_REQUEST['field_where'])) {
$form_params['after_field'] = $_REQUEST['after_field'];
if (isset($_POST['field_where'])) {
$form_params['after_field'] = $_POST['after_field'];
}
}
$form_params['table'] = $table;
@ -80,8 +80,8 @@ if (isset($num_fields)) {
$form_params = array_merge(
$form_params,
[
'orig_field_where' => Util::getValueByKey($_REQUEST, 'field_where'),
'orig_after_field' => Util::getValueByKey($_REQUEST, 'after_field'),
'orig_field_where' => Util::getValueByKey($_POST, 'field_where'),
'orig_after_field' => Util::getValueByKey($_POST, 'after_field'),
]
);
@ -129,8 +129,8 @@ if (isset($field_fulltext) && is_array($field_fulltext)) {
$submit_fulltext[$fulltext_indexkey] = $fulltext_indexkey;
}
}
if (isset($_REQUEST['submit_num_fields'])
|| isset($_REQUEST['submit_partition_change'])
if (isset($_POST['submit_num_fields'])
|| isset($_POST['submit_partition_change'])
) {
//if adding new fields, set regenerate to keep the original values
$regenerate = 1;
@ -156,47 +156,47 @@ for ($columnNumber = 0; $columnNumber < $num_fields; $columnNumber++) {
$columnMeta,
[
'Field' => Util::getValueByKey(
$_REQUEST,
$_POST,
"field_name.${columnNumber}",
null
),
'Type' => Util::getValueByKey(
$_REQUEST,
$_POST,
"field_type.${columnNumber}",
null
),
'Collation' => Util::getValueByKey(
$_REQUEST,
$_POST,
"field_collation.${columnNumber}",
''
),
'Null' => Util::getValueByKey(
$_REQUEST,
$_POST,
"field_null.${columnNumber}",
''
),
'DefaultType' => Util::getValueByKey(
$_REQUEST,
$_POST,
"field_default_type.${columnNumber}",
'NONE'
),
'DefaultValue' => Util::getValueByKey(
$_REQUEST,
$_POST,
"field_default_value.${columnNumber}",
''
),
'Extra' => Util::getValueByKey(
$_REQUEST,
$_POST,
"field_extra.${columnNumber}",
null
),
'Virtuality' => Util::getValueByKey(
$_REQUEST,
$_POST,
"field_virtuality.${columnNumber}",
''
),
'Expression' => Util::getValueByKey(
$_REQUEST,
$_POST,
"field_expression.${columnNumber}",
''
),
@ -206,7 +206,7 @@ for ($columnNumber = 0; $columnNumber < $num_fields; $columnNumber++) {
$columnMeta['Key'] = '';
$parts = explode(
'_',
Util::getValueByKey($_REQUEST, "field_key.${columnNumber}", ''),
Util::getValueByKey($_POST, "field_key.${columnNumber}", ''),
2
);
if (count($parts) == 2 && $parts[1] == $columnNumber) {
@ -242,27 +242,27 @@ for ($columnNumber = 0; $columnNumber < $num_fields; $columnNumber++) {
break;
}
$length = Util::getValueByKey($_REQUEST, "field_length.${columnNumber}", $length);
$length = Util::getValueByKey($_POST, "field_length.${columnNumber}", $length);
$submit_attribute = Util::getValueByKey(
$_REQUEST,
$_POST,
"field_attribute.${columnNumber}",
false
);
$comments_map[$columnMeta['Field']] = Util::getValueByKey(
$_REQUEST,
$_POST,
"field_comments.${columnNumber}"
);
$mime_map[$columnMeta['Field']] = array_merge(
$mime_map[$columnMeta['Field']],
[
'mimetype' => Util::getValueByKey($_REQUEST, "field_mimetype.${$columnNumber}"),
'mimetype' => Util::getValueByKey($_POST, "field_mimetype.${$columnNumber}"),
'transformation' => Util::getValueByKey(
$_REQUEST,
$_POST,
"field_transformation.${$columnNumber}"
),
'transformation_options' => Util::getValueByKey(
$_REQUEST,
$_POST,
"field_transformation_options.${$columnNumber}"
),
]
@ -472,17 +472,17 @@ $html = $template->render('columns_definitions/column_definitions_form', [
'form_params' => $form_params,
'content_cells' => $content_cells,
'partition_details' => $partitionDetails,
'primary_indexes' => isset($_REQUEST['primary_indexes']) ? $_REQUEST['primary_indexes'] : null,
'unique_indexes' => isset($_REQUEST['unique_indexes']) ? $_REQUEST['unique_indexes'] : null,
'indexes' => isset($_REQUEST['indexes']) ? $_REQUEST['indexes'] : null,
'fulltext_indexes' => isset($_REQUEST['fulltext_indexes']) ? $_REQUEST['fulltext_indexes'] : null,
'spatial_indexes' => isset($_REQUEST['spatial_indexes']) ? $_REQUEST['spatial_indexes'] : null,
'table' => isset($_REQUEST['table']) ? $_REQUEST['table'] : null,
'comment' => isset($_REQUEST['comment']) ? $_REQUEST['comment'] : null,
'tbl_collation' => isset($_REQUEST['tbl_collation']) ? $_REQUEST['tbl_collation'] : null,
'tbl_storage_engine' => isset($_REQUEST['tbl_storage_engine']) ? $_REQUEST['tbl_storage_engine'] : null,
'connection' => isset($_REQUEST['connection']) ? $_REQUEST['connection'] : null,
'change_column' => isset($_REQUEST['change_column']) ? $_REQUEST['change_column'] : null,
'primary_indexes' => isset($_POST['primary_indexes']) ? $_POST['primary_indexes'] : null,
'unique_indexes' => isset($_POST['unique_indexes']) ? $_POST['unique_indexes'] : null,
'indexes' => isset($_POST['indexes']) ? $_POST['indexes'] : null,
'fulltext_indexes' => isset($_POST['fulltext_indexes']) ? $_POST['fulltext_indexes'] : null,
'spatial_indexes' => isset($_POST['spatial_indexes']) ? $_POST['spatial_indexes'] : null,
'table' => isset($_POST['table']) ? $_POST['table'] : null,
'comment' => isset($_POST['comment']) ? $_POST['comment'] : null,
'tbl_collation' => isset($_POST['tbl_collation']) ? $_POST['tbl_collation'] : null,
'tbl_storage_engine' => isset($_POST['tbl_storage_engine']) ? $_POST['tbl_storage_engine'] : null,
'connection' => isset($_POST['connection']) ? $_POST['connection'] : null,
'change_column' => isset($_POST['change_column']) ? $_POST['change_column'] : null,
'is_virtual_columns_supported' => Util::isVirtualColumnsSupported(),
'browse_mime' => isset($GLOBALS['cfg']['BrowseMIME']) ? $GLOBALS['cfg']['BrowseMIME'] : null,
'server_type' => Util::getServerType(),

View File

@ -18,21 +18,21 @@ if (!isset($partitionDetails)) {
'subpartition_by', 'subpartition_expr',
];
foreach ($partitionParams as $partitionParam) {
$partitionDetails[$partitionParam] = isset($_REQUEST[$partitionParam])
? $_REQUEST[$partitionParam] : '';
$partitionDetails[$partitionParam] = isset($_POST[$partitionParam])
? $_POST[$partitionParam] : '';
}
if (Core::isValid($_REQUEST['partition_count'], 'numeric')) {
if (Core::isValid($_POST['partition_count'], 'numeric')) {
// MySQL's limit is 8192, so do not allow more
$partition_count = min(intval($_REQUEST['partition_count']), 8192);
$partition_count = min(intval($_POST['partition_count']), 8192);
} else {
$partition_count = 0;
}
$partitionDetails['partition_count']
= ($partition_count === 0) ? '' : $partition_count;
if (Core::isValid($_REQUEST['subpartition_count'], 'numeric')) {
if (Core::isValid($_POST['subpartition_count'], 'numeric')) {
// MySQL's limit is 8192, so do not allow more
$subpartition_count = min(intval($_REQUEST['subpartition_count']), 8192);
$subpartition_count = min(intval($_POST['subpartition_count']), 8192);
} else {
$subpartition_count = 0;
}
@ -41,23 +41,23 @@ if (!isset($partitionDetails)) {
// Only LIST and RANGE type parameters allow subpartitioning
$partitionDetails['can_have_subpartitions'] = $partition_count > 1
&& isset($_REQUEST['partition_by'])
&& ($_REQUEST['partition_by'] == 'RANGE'
|| $_REQUEST['partition_by'] == 'RANGE COLUMNS'
|| $_REQUEST['partition_by'] == 'LIST'
|| $_REQUEST['partition_by'] == 'LIST COLUMNS');
&& isset($_POST['partition_by'])
&& ($_POST['partition_by'] == 'RANGE'
|| $_POST['partition_by'] == 'RANGE COLUMNS'
|| $_POST['partition_by'] == 'LIST'
|| $_POST['partition_by'] == 'LIST COLUMNS');
// Values are specified only for LIST and RANGE type partitions
$partitionDetails['value_enabled'] = isset($_REQUEST['partition_by'])
&& ($_REQUEST['partition_by'] == 'RANGE'
|| $_REQUEST['partition_by'] == 'RANGE COLUMNS'
|| $_REQUEST['partition_by'] == 'LIST'
|| $_REQUEST['partition_by'] == 'LIST COLUMNS');
$partitionDetails['value_enabled'] = isset($_POST['partition_by'])
&& ($_POST['partition_by'] == 'RANGE'
|| $_POST['partition_by'] == 'RANGE COLUMNS'
|| $_POST['partition_by'] == 'LIST'
|| $_POST['partition_by'] == 'LIST COLUMNS');
// Has partitions
if ($partition_count > 1) {
$partitions = isset($_REQUEST['partitions'])
? $_REQUEST['partitions']
$partitions = isset($_POST['partitions'])
? $_POST['partitions']
: [];
// Remove details of the additional partitions

View File

@ -26,7 +26,7 @@ if (! $response->isAjax()) {
exit;
}
if (isset($_REQUEST['getNaviSettings']) && $_REQUEST['getNaviSettings']) {
if (isset($_POST['getNaviSettings']) && $_POST['getNaviSettings']) {
$response->addJSON('message', PageSettings::getNaviSettings());
exit();
}
@ -34,41 +34,41 @@ if (isset($_REQUEST['getNaviSettings']) && $_REQUEST['getNaviSettings']) {
$relation = new Relation($GLOBALS['dbi']);
$cfgRelation = $relation->getRelationsParam();
if ($cfgRelation['navwork']) {
if (isset($_REQUEST['hideNavItem'])) {
if (! empty($_REQUEST['itemName'])
&& ! empty($_REQUEST['itemType'])
&& ! empty($_REQUEST['dbName'])
if (isset($_POST['hideNavItem'])) {
if (! empty($_POST['itemName'])
&& ! empty($_POST['itemType'])
&& ! empty($_POST['dbName'])
) {
$navigation->hideNavigationItem(
$_REQUEST['itemName'],
$_REQUEST['itemType'],
$_REQUEST['dbName'],
(! empty($_REQUEST['tableName']) ? $_REQUEST['tableName'] : null)
$_POST['itemName'],
$_POST['itemType'],
$_POST['dbName'],
(! empty($_POST['tableName']) ? $_POST['tableName'] : null)
);
}
exit;
}
if (isset($_REQUEST['unhideNavItem'])) {
if (! empty($_REQUEST['itemName'])
&& ! empty($_REQUEST['itemType'])
&& ! empty($_REQUEST['dbName'])
if (isset($_POST['unhideNavItem'])) {
if (! empty($_POST['itemName'])
&& ! empty($_POST['itemType'])
&& ! empty($_POST['dbName'])
) {
$navigation->unhideNavigationItem(
$_REQUEST['itemName'],
$_REQUEST['itemType'],
$_REQUEST['dbName'],
(! empty($_REQUEST['tableName']) ? $_REQUEST['tableName'] : null)
$_POST['itemName'],
$_POST['itemType'],
$_POST['dbName'],
(! empty($_POST['tableName']) ? $_POST['tableName'] : null)
);
}
exit;
}
if (isset($_REQUEST['showUnhideDialog'])) {
if (! empty($_REQUEST['dbName'])) {
if (isset($_POST['showUnhideDialog'])) {
if (! empty($_POST['dbName'])) {
$response->addJSON(
'message',
$navigation->getItemUnhideDialog($_REQUEST['dbName'])
$navigation->getItemUnhideDialog($_POST['dbName'])
);
}
exit;

View File

@ -16,7 +16,7 @@ require_once 'libraries/common.inc.php';
$normalization = new Normalization($GLOBALS['dbi']);
if (isset($_REQUEST['getColumns'])) {
if (isset($_POST['getColumns'])) {
$html = '<option selected disabled>' . __('Select one…') . '</option>'
. '<option value="no_such_col">' . __('No such column') . '</option>';
//get column whose datatype falls under string category
@ -28,14 +28,14 @@ if (isset($_REQUEST['getColumns'])) {
echo $html;
exit;
}
if (isset($_REQUEST['splitColumn'])) {
$num_fields = min(4096, intval($_REQUEST['numFields']));
if (isset($_POST['splitColumn'])) {
$num_fields = min(4096, intval($_POST['numFields']));
$html = $normalization->getHtmlForCreateNewColumn($num_fields, $db, $table);
$html .= Url::getHiddenInputs($db, $table);
echo $html;
exit;
}
if (isset($_REQUEST['addNewPrimary'])) {
if (isset($_POST['addNewPrimary'])) {
$num_fields = 1;
$columnMeta = ['Field' => $table . "_id", 'Extra' => 'auto_increment'];
$html = $normalization->getHtmlForCreateNewColumn(
@ -48,14 +48,14 @@ if (isset($_REQUEST['addNewPrimary'])) {
echo $html;
exit;
}
if (isset($_REQUEST['findPdl'])) {
if (isset($_POST['findPdl'])) {
$html = $normalization->findPartialDependencies($table, $db);
echo $html;
exit;
}
if (isset($_REQUEST['getNewTables2NF'])) {
$partialDependencies = json_decode($_REQUEST['pd']);
if (isset($_POST['getNewTables2NF'])) {
$partialDependencies = json_decode($_POST['pd']);
$html = $normalization->getHtmlForNewTables2NF($partialDependencies, $table);
echo $html;
exit;
@ -63,9 +63,9 @@ if (isset($_REQUEST['getNewTables2NF'])) {
$response = Response::getInstance();
if (isset($_REQUEST['getNewTables3NF'])) {
$dependencies = json_decode($_REQUEST['pd']);
$tables = json_decode($_REQUEST['tables']);
if (isset($_POST['getNewTables3NF'])) {
$dependencies = json_decode($_POST['pd']);
$tables = json_decode($_POST['tables']);
$newTables = $normalization->getHtmlForNewTables3NF($dependencies, $tables, $db);
$response->disable();
Core::headerJSON();
@ -78,18 +78,18 @@ $scripts = $header->getScripts();
$scripts->addFile('normalization.js');
$scripts->addFile('vendor/jquery/jquery.uitablefilter.js');
$normalForm = '1nf';
if (Core::isValid($_REQUEST['normalizeTo'], ['1nf', '2nf', '3nf'])) {
$normalForm = $_REQUEST['normalizeTo'];
if (Core::isValid($_POST['normalizeTo'], ['1nf', '2nf', '3nf'])) {
$normalForm = $_POST['normalizeTo'];
}
if (isset($_REQUEST['createNewTables2NF'])) {
$partialDependencies = json_decode($_REQUEST['pd']);
$tablesName = json_decode($_REQUEST['newTablesName']);
if (isset($_POST['createNewTables2NF'])) {
$partialDependencies = json_decode($_POST['pd']);
$tablesName = json_decode($_POST['newTablesName']);
$res = $normalization->createNewTablesFor2NF($partialDependencies, $tablesName, $table, $db);
$response->addJSON($res);
exit;
}
if (isset($_REQUEST['createNewTables3NF'])) {
$newtables = json_decode($_REQUEST['newTables']);
if (isset($_POST['createNewTables3NF'])) {
$newtables = json_decode($_POST['newTables']);
$res = $normalization->createNewTablesFor3NF($newtables, $db);
$response->addJSON($res);
exit;
@ -110,23 +110,23 @@ if (isset($_POST['repeatingColumns'])) {
$response->addJSON($res);
exit;
}
if (isset($_REQUEST['step1'])) {
if (isset($_POST['step1'])) {
$html = $normalization->getHtmlFor1NFStep1($db, $table, $normalForm);
$response->addHTML($html);
} elseif (isset($_REQUEST['step2'])) {
} elseif (isset($_POST['step2'])) {
$res = $normalization->getHtmlContentsFor1NFStep2($db, $table);
$response->addJSON($res);
} elseif (isset($_REQUEST['step3'])) {
} elseif (isset($_POST['step3'])) {
$res = $normalization->getHtmlContentsFor1NFStep3($db, $table);
$response->addJSON($res);
} elseif (isset($_REQUEST['step4'])) {
} elseif (isset($_POST['step4'])) {
$res = $normalization->getHtmlContentsFor1NFStep4($db, $table);
$response->addJSON($res);
} elseif (isset($_REQUEST['step']) && $_REQUEST['step'] == '2.1') {
} elseif (isset($_POST['step']) && $_POST['step'] == '2.1') {
$res = $normalization->getHtmlFor2NFstep1($db, $table);
$response->addJSON($res);
} elseif (isset($_REQUEST['step']) && $_REQUEST['step'] == '3.1') {
$tables = $_REQUEST['tables'];
} elseif (isset($_POST['step']) && $_POST['step'] == '3.1') {
$tables = $_POST['tables'];
$res = $normalization->getHtmlFor3NFstep1($db, $tables);
$response->addJSON($res);
} else {

View File

@ -42,8 +42,8 @@ $template = new Template();
$relationCleanup = new RelationCleanup($GLOBALS['dbi'], $relation);
$serverPrivileges = new Privileges($template, $GLOBALS['dbi'], $relation, $relationCleanup);
if ((isset($_REQUEST['viewing_mode'])
&& $_REQUEST['viewing_mode'] == 'server')
if ((isset($_GET['viewing_mode'])
&& $_GET['viewing_mode'] == 'server')
&& $GLOBALS['cfgRelation']['menuswork']
) {
$response->addHTML('<div>');
@ -161,8 +161,8 @@ if (! $GLOBALS['is_grantuser'] && !$GLOBALS['is_createuser']) {
* Checks if the user is using "Change Login Information / Copy User" dialog
* only to update the password
*/
if (isset($_REQUEST['change_copy']) && $username == $_REQUEST['old_username']
&& $hostname == $_REQUEST['old_hostname']
if (isset($_POST['change_copy']) && $username == $_POST['old_username']
&& $hostname == $_POST['old_hostname']
) {
$response->addHTML(
Message::error(
@ -207,7 +207,7 @@ if (isset($ret_message)) {
/**
* Changes / copies a user, part III
*/
if (isset($_REQUEST['change_copy'])) {
if (isset($_POST['change_copy'])) {
$queries = $serverPrivileges->getDbSpecificPrivsQueriesForChangeOrCopyUser(
$queries,
$username,
@ -254,17 +254,17 @@ if (! empty($_POST['update_privs'])) {
/**
* Assign users to user groups
*/
if (! empty($_REQUEST['changeUserGroup']) && $cfgRelation['menuswork']
if (! empty($_POST['changeUserGroup']) && $cfgRelation['menuswork']
&& $GLOBALS['dbi']->isSuperuser() && $GLOBALS['is_createuser']
) {
$serverPrivileges->setUserGroup($username, $_REQUEST['userGroup']);
$serverPrivileges->setUserGroup($username, $_POST['userGroup']);
$message = Message::success();
}
/**
* Revokes Privileges
*/
if (isset($_REQUEST['revokeall'])) {
if (isset($_POST['revokeall'])) {
list ($message, $sql_query) = $serverPrivileges->getMessageAndSqlQueryForPrivilegesRevoke(
(isset($dbname) ? $dbname : ''),
(isset($tablename)
@ -279,7 +279,7 @@ if (isset($_REQUEST['revokeall'])) {
/**
* Updates the password
*/
if (isset($_REQUEST['change_pw'])) {
if (isset($_POST['change_pw'])) {
$message = $serverPrivileges->updatePassword(
$err_url,
$username,
@ -291,11 +291,11 @@ if (isset($_REQUEST['change_pw'])) {
* Deletes users
* (Changes / copies a user, part IV)
*/
if (isset($_REQUEST['delete'])
|| (isset($_REQUEST['change_copy']) && $_REQUEST['mode'] < 4)
if (isset($_POST['delete'])
|| (isset($_POST['change_copy']) && $_POST['mode'] < 4)
) {
$queries = $serverPrivileges->getDataForDeleteUsers($queries);
if (empty($_REQUEST['change_copy'])) {
if (empty($_POST['change_copy'])) {
list($sql_query, $message) = $serverPrivileges->deleteUser($queries);
}
}
@ -303,7 +303,7 @@ if (isset($_REQUEST['delete'])
/**
* Changes / copies a user, part V
*/
if (isset($_REQUEST['change_copy'])) {
if (isset($_POST['change_copy'])) {
$queries = $serverPrivileges->getDataForQueries($queries, $queries_for_display);
$message = Message::success();
$sql_query = join("\n", $queries);
@ -324,14 +324,13 @@ if (! is_null($message_ret)) {
*/
if ($response->isAjax()
&& empty($_REQUEST['ajax_page_request'])
&& ! isset($_REQUEST['export'])
&& (! isset($_REQUEST['submit_mult']) || $_REQUEST['submit_mult'] != 'export')
&& ((! isset($_REQUEST['initial']) || $_REQUEST['initial'] === null
|| $_REQUEST['initial'] === '')
|| (isset($_REQUEST['delete']) && $_REQUEST['delete'] === __('Go')))
&& ! isset($_REQUEST['showall'])
&& ! isset($_REQUEST['edit_user_group_dialog'])
&& ! isset($_REQUEST['db_specific'])
&& ! isset($_GET['export'])
&& (! isset($_POST['submit_mult']) || $_POST['submit_mult'] != 'export')
&& ((! isset($_GET['initial']) || $_GET['initial'] === null
|| $_GET['initial'] === '')
|| (isset($_POST['delete']) && $_POST['delete'] === __('Go')))
&& ! isset($_GET['showall'])
&& ! isset($_GET['edit_user_group_dialog'])
) {
$extra_data = $serverPrivileges->getExtraDataForAjaxBehavior(
(isset($password) ? $password : ''),
@ -351,8 +350,8 @@ if ($response->isAjax()
/**
* Displays the links
*/
if (isset($_REQUEST['viewing_mode']) && $_REQUEST['viewing_mode'] == 'db') {
$GLOBALS['db'] = $_REQUEST['db'] = $_REQUEST['checkprivsdb'];
if (isset($_GET['viewing_mode']) && $_GET['viewing_mode'] == 'db') {
$GLOBALS['db'] = $_REQUEST['db'] = $_GET['checkprivsdb'];
$url_query .= '&amp;goto=db_operations.php';
@ -393,8 +392,8 @@ $response->addHTML(
);
// export user definition
if (isset($_REQUEST['export'])
|| (isset($_REQUEST['submit_mult']) && $_REQUEST['submit_mult'] == 'export')
if (isset($_GET['export'])
|| (isset($_POST['submit_mult']) && $_POST['submit_mult'] == 'export')
) {
list($title, $export) = $serverPrivileges->getListForExportUserDefinition(
isset($username) ? $username : null,
@ -412,24 +411,24 @@ if (isset($_REQUEST['export'])
}
}
if (isset($_REQUEST['adduser'])) {
if (isset($_GET['adduser'])) {
// Add user
$response->addHTML(
$serverPrivileges->getHtmlForAddUser((isset($dbname) ? $dbname : ''))
);
} elseif (isset($_REQUEST['checkprivsdb'])) {
if (isset($_REQUEST['checkprivstable'])) {
} elseif (isset($_GET['checkprivsdb'])) {
if (isset($_GET['checkprivstable'])) {
// check the privileges for a particular table.
$response->addHTML(
$serverPrivileges->getHtmlForSpecificTablePrivileges(
$_REQUEST['checkprivsdb'],
$_REQUEST['checkprivstable']
$_GET['checkprivsdb'],
$_GET['checkprivstable']
)
);
} else {
// check the privileges for a particular database.
$response->addHTML(
$serverPrivileges->getHtmlForSpecificDbPrivileges($_REQUEST['checkprivsdb'])
$serverPrivileges->getHtmlForSpecificDbPrivileges($_GET['checkprivsdb'])
);
}
} else {
@ -478,7 +477,7 @@ if (isset($_REQUEST['adduser'])) {
}
}
if ((isset($_REQUEST['viewing_mode']) && $_REQUEST['viewing_mode'] == 'server')
if ((isset($_GET['viewing_mode']) && $_GET['viewing_mode'] == 'server')
&& $GLOBALS['cfgRelation']['menuswork']
) {
$response->addHTML('</div>');

View File

@ -43,10 +43,10 @@ if (! $GLOBALS['dbi']->isSuperuser()) {
exit;
}
// change $GLOBALS['url_params'] with $_REQUEST['url_params']
// change $GLOBALS['url_params'] with $_POST['url_params']
// only if it is an array
if (isset($_REQUEST['url_params']) && is_array($_REQUEST['url_params'])) {
$GLOBALS['url_params'] = $_REQUEST['url_params'];
if (isset($_POST['url_params']) && is_array($_POST['url_params'])) {
$GLOBALS['url_params'] = $_POST['url_params'];
}
$replicationGui = new ReplicationGui();
@ -69,13 +69,13 @@ $response->addHTML($replicationGui->getHtmlForErrorMessage());
if ($GLOBALS['replication_info']['master']['status']) {
$response->addHTML($replicationGui->getHtmlForMasterReplication());
} elseif (! isset($_REQUEST['mr_configure'])
&& ! isset($_REQUEST['repl_clear_scr'])
} elseif (! isset($_POST['mr_configure'])
&& ! isset($_POST['repl_clear_scr'])
) {
$response->addHTML($replicationGui->getHtmlForNotServerReplication());
}
if (isset($_REQUEST['mr_configure'])) {
if (isset($_POST['mr_configure'])) {
// Render the 'Master configuration' section
$response->addHTML($replicationGui->getHtmlForMasterConfiguration());
exit;
@ -83,7 +83,7 @@ if (isset($_REQUEST['mr_configure'])) {
$response->addHTML('</div>');
if (! isset($_REQUEST['repl_clear_scr'])) {
if (! isset($_POST['repl_clear_scr'])) {
// Render the 'Slave configuration' section
$response->addHTML(
$replicationGui->getHtmlForSlaveConfiguration(
@ -92,6 +92,6 @@ if (! isset($_REQUEST['repl_clear_scr'])) {
)
);
}
if (isset($_REQUEST['sl_configure'])) {
if (isset($_POST['sl_configure'])) {
$response->addHTML($replicationGui->getHtmlForReplicationChangeMaster("slave_changemaster"));
}

View File

@ -28,8 +28,8 @@ if ($response->isAjax()) {
header('Content-Type: text/html; charset=UTF-8');
// real-time charting data
if (isset($_REQUEST['chart_data'])) {
switch ($_REQUEST['type']) {
if (isset($_POST['chart_data'])) {
switch ($_POST['type']) {
case 'chartgrid': // Data for the monitor
$ret = $statusMonitor->getJsonForChartingData();
$response->addJSON('message', $ret);
@ -37,30 +37,30 @@ if ($response->isAjax()) {
}
}
if (isset($_REQUEST['log_data'])) {
$start = intval($_REQUEST['time_start']);
$end = intval($_REQUEST['time_end']);
if (isset($_POST['log_data'])) {
$start = intval($_POST['time_start']);
$end = intval($_POST['time_end']);
if ($_REQUEST['type'] == 'slow') {
if ($_POST['type'] == 'slow') {
$return = $statusMonitor->getJsonForLogDataTypeSlow($start, $end);
$response->addJSON('message', $return);
exit;
}
if ($_REQUEST['type'] == 'general') {
if ($_POST['type'] == 'general') {
$return = $statusMonitor->getJsonForLogDataTypeGeneral($start, $end);
$response->addJSON('message', $return);
exit;
}
}
if (isset($_REQUEST['logging_vars'])) {
if (isset($_POST['logging_vars'])) {
$loggingVars = $statusMonitor->getJsonForLoggingVars();
$response->addJSON('message', $loggingVars);
exit;
}
if (isset($_REQUEST['query_analyzer'])) {
if (isset($_POST['query_analyzer'])) {
$return = $statusMonitor->getJsonForQueryAnalyzer();
$response->addJSON('message', $return);
exit;

View File

@ -26,8 +26,8 @@ $response = Response::getInstance();
* Kills a selected process
* on ajax request
*/
if ($response->isAjax() && !empty($_REQUEST['kill'])) {
$kill = intval($_REQUEST['kill']);
if ($response->isAjax() && !empty($_POST['kill'])) {
$kill = intval($_POST['kill']);
$query = $GLOBALS['dbi']->getKillQuery($kill);
if ($GLOBALS['dbi']->tryQuery($query)) {
$message = PhpMyAdmin\Message::success(
@ -45,7 +45,7 @@ if ($response->isAjax() && !empty($_REQUEST['kill'])) {
}
$message->addParam($kill);
$response->addJSON('message', $message);
} elseif ($response->isAjax() && !empty($_REQUEST['refresh'])) {
} elseif ($response->isAjax() && !empty($_POST['refresh'])) {
// Only sends the process list table
$response->addHTML(Processes::getHtmlForServerProcesslist());
} else {

View File

@ -19,15 +19,15 @@ require_once 'libraries/replication.inc.php';
/**
* flush status variables if requested
*/
if (isset($_REQUEST['flush'])) {
if (isset($_POST['flush'])) {
$_flush_commands = [
'STATUS',
'TABLES',
'QUERY CACHE',
];
if (in_array($_REQUEST['flush'], $_flush_commands)) {
$GLOBALS['dbi']->query('FLUSH ' . $_REQUEST['flush'] . ';');
if (in_array($_POST['flush'], $_flush_commands)) {
$GLOBALS['dbi']->query('FLUSH ' . $_POST['flush'] . ';');
}
unset($_flush_commands);
}

View File

@ -42,35 +42,35 @@ $response->addHTML(Users::getHtmlForSubMenusOnUsersPage('server_user_groups.php'
/**
* Delete user group
*/
if (! empty($_REQUEST['deleteUserGroup'])) {
UserGroups::delete($_REQUEST['userGroup']);
if (! empty($_POST['deleteUserGroup'])) {
UserGroups::delete($_POST['userGroup']);
}
/**
* Add a new user group
*/
if (! empty($_REQUEST['addUserGroupSubmit'])) {
UserGroups::edit($_REQUEST['userGroup'], true);
if (! empty($_POST['addUserGroupSubmit'])) {
UserGroups::edit($_POST['userGroup'], true);
}
/**
* Update a user group
*/
if (! empty($_REQUEST['editUserGroupSubmit'])) {
UserGroups::edit($_REQUEST['userGroup']);
if (! empty($_POST['editUserGroupSubmit'])) {
UserGroups::edit($_POST['userGroup']);
}
if (isset($_REQUEST['viewUsers'])) {
if (isset($_POST['viewUsers'])) {
// Display users belonging to a user group
$response->addHTML(UserGroups::getHtmlForListingUsersofAGroup($_REQUEST['userGroup']));
$response->addHTML(UserGroups::getHtmlForListingUsersofAGroup($_POST['userGroup']));
}
if (isset($_REQUEST['addUserGroup'])) {
if (isset($_GET['addUserGroup'])) {
// Display add user group dialog
$response->addHTML(UserGroups::getHtmlToEditUserGroup());
} elseif (isset($_REQUEST['editUserGroup'])) {
} elseif (isset($_POST['editUserGroup'])) {
// Display edit user group dialog
$response->addHTML(UserGroups::getHtmlToEditUserGroup($_REQUEST['userGroup']));
$response->addHTML(UserGroups::getHtmlToEditUserGroup($_POST['userGroup']));
} else {
// Display user groups table
$response->addHTML(UserGroups::getHtmlForUserGroupsTable());

14
sql.php
View File

@ -83,28 +83,28 @@ if (isset($_POST['bkm_fields']['bkm_database'])) {
}
// During grid edit, if we have a relational field, show the dropdown for it.
if (isset($_REQUEST['get_relational_values'])
&& $_REQUEST['get_relational_values'] == true
if (isset($_POST['get_relational_values'])
&& $_POST['get_relational_values'] == true
) {
$sql->getRelationalValues($db, $table);
// script has exited at this point
}
// Just like above, find possible values for enum fields during grid edit.
if (isset($_REQUEST['get_enum_values']) && $_REQUEST['get_enum_values'] == true) {
if (isset($_POST['get_enum_values']) && $_POST['get_enum_values'] == true) {
$sql->getEnumOrSetValues($db, $table, "enum");
// script has exited at this point
}
// Find possible values for set fields during grid edit.
if (isset($_REQUEST['get_set_values']) && $_REQUEST['get_set_values'] == true) {
if (isset($_POST['get_set_values']) && $_POST['get_set_values'] == true) {
$sql->getEnumOrSetValues($db, $table, "set");
// script has exited at this point
}
if (isset($_REQUEST['get_default_fk_check_value'])
&& $_REQUEST['get_default_fk_check_value'] == true
if (isset($_GET['get_default_fk_check_value'])
&& $_GET['get_default_fk_check_value'] == true
) {
$response = Response::getInstance();
$response->addJSON(
@ -117,7 +117,7 @@ if (isset($_REQUEST['get_default_fk_check_value'])
/**
* Check ajax request to set the column order and visibility
*/
if (isset($_REQUEST['set_col_prefs']) && $_REQUEST['set_col_prefs'] == true) {
if (isset($_POST['set_col_prefs']) && $_POST['set_col_prefs'] == true) {
$sql->setColumnOrderOrVisibility($table, $db);
// script has exited at this point
}

View File

@ -44,28 +44,28 @@ $err_url = 'tbl_sql.php' . Url::getCommon(
$abort = false;
// check number of fields to be created
if (isset($_REQUEST['submit_num_fields'])) {
if (isset($_REQUEST['orig_after_field'])) {
$_REQUEST['after_field'] = $_REQUEST['orig_after_field'];
if (isset($_POST['submit_num_fields'])) {
if (isset($_POST['orig_after_field'])) {
$_POST['after_field'] = $_POST['orig_after_field'];
}
if (isset($_REQUEST['orig_field_where'])) {
$_REQUEST['field_where'] = $_REQUEST['orig_field_where'];
if (isset($_POST['orig_field_where'])) {
$_POST['field_where'] = $_POST['orig_field_where'];
}
$num_fields = min(
intval($_REQUEST['orig_num_fields']) + intval($_REQUEST['added_fields']),
intval($_POST['orig_num_fields']) + intval($_POST['added_fields']),
4096
);
$regenerate = true;
} elseif (isset($_REQUEST['num_fields']) && intval($_REQUEST['num_fields']) > 0) {
$num_fields = min(4096, intval($_REQUEST['num_fields']));
} elseif (isset($_POST['num_fields']) && intval($_POST['num_fields']) > 0) {
$num_fields = min(4096, intval($_POST['num_fields']));
} else {
$num_fields = 1;
}
if (isset($_REQUEST['do_save_data'])) {
if (isset($_POST['do_save_data'])) {
//avoid an incorrect calling of PMA_updateColumns() via
//tbl_structure.php below
unset($_REQUEST['do_save_data']);
unset($_POST['do_save_data']);
$createAddField = new CreateAddField($GLOBALS['dbi']);
@ -73,23 +73,23 @@ if (isset($_REQUEST['do_save_data'])) {
if ($result === true) {
// Update comment table for mime types [MIME]
if (isset($_REQUEST['field_mimetype'])
&& is_array($_REQUEST['field_mimetype'])
if (isset($_POST['field_mimetype'])
&& is_array($_POST['field_mimetype'])
&& $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
) {
$transformations->setMime(
$db,
$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]
);
}
}

View File

@ -67,11 +67,11 @@ $action = 'tbl_create.php';
/**
* The form used to define the structure of the table has been submitted
*/
if (isset($_REQUEST['do_save_data'])) {
if (isset($_POST['do_save_data'])) {
$sql_query = $createAddField->getTableCreationQuery($db, $table);
// If there is a request for SQL previewing.
if (isset($_REQUEST['preview_sql'])) {
if (isset($_POST['preview_sql'])) {
Core::previewSQL($sql_query);
}
// Executes the query
@ -79,23 +79,23 @@ if (isset($_REQUEST['do_save_data'])) {
if ($result) {
// Update comment table for mime types [MIME]
if (isset($_REQUEST['field_mimetype'])
&& is_array($_REQUEST['field_mimetype'])
if (isset($_POST['field_mimetype'])
&& is_array($_POST['field_mimetype'])
&& $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
) {
$transformations->setMime(
$db,
$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]
);
}
}

View File

@ -31,7 +31,7 @@ $cfgRelation = $relation->getRelationsParam();
$displayExport = new Export();
// handling export template actions
if (isset($_REQUEST['templateAction']) && $cfgRelation['exporttemplateswork']) {
if (isset($_POST['templateAction']) && $cfgRelation['exporttemplateswork']) {
$displayExport->handleTemplateActions($cfgRelation);
exit;
}

View File

@ -28,15 +28,15 @@ $db = $container->get('db');
$table = $container->get('table');
$dbi = $container->get('dbi');
if (!isset($_REQUEST['create_edit_table'])) {
if (!isset($_POST['create_edit_table'])) {
include_once 'libraries/tbl_common.inc.php';
}
if (isset($_REQUEST['index'])) {
if (is_array($_REQUEST['index'])) {
if (isset($_POST['index'])) {
if (is_array($_POST['index'])) {
// coming already from form
$index = new Index($_REQUEST['index']);
$index = new Index($_POST['index']);
} else {
$index = $dbi->getTable($db, $table)->getIndex($_REQUEST['index']);
$index = $dbi->getTable($db, $table)->getIndex($_POST['index']);
}
} else {
$index = new Index();

View File

@ -102,7 +102,7 @@ $table_alters = [];
/**
* If the table has to be moved to some other database
*/
if (isset($_REQUEST['submit_move']) || isset($_REQUEST['submit_copy'])) {
if (isset($_POST['submit_move']) || isset($_POST['submit_copy'])) {
//$_message = '';
$operations->moveOrCopyTable($db, $table);
// This was ended in an Ajax call
@ -111,31 +111,31 @@ if (isset($_REQUEST['submit_move']) || isset($_REQUEST['submit_copy'])) {
/**
* If the table has to be maintained
*/
if (isset($_REQUEST['table_maintenance'])) {
if (isset($_POST['table_maintenance'])) {
include_once 'sql.php';
unset($result);
}
/**
* Updates table comment, type and options if required
*/
if (isset($_REQUEST['submitoptions'])) {
if (isset($_POST['submitoptions'])) {
$_message = '';
$warning_messages = [];
if (isset($_REQUEST['new_name'])) {
if (isset($_POST['new_name'])) {
// Get original names before rename operation
$oldTable = $pma_table->getName();
$oldDb = $pma_table->getDbName();
if ($pma_table->rename($_REQUEST['new_name'])) {
if (isset($_REQUEST['adjust_privileges'])
&& ! empty($_REQUEST['adjust_privileges'])
if ($pma_table->rename($_POST['new_name'])) {
if (isset($_POST['adjust_privileges'])
&& ! empty($_POST['adjust_privileges'])
) {
$operations->adjustPrivilegesRenameOrMoveTable(
$oldDb,
$oldTable,
$_REQUEST['db'],
$_REQUEST['new_name']
$_POST['db'],
$_POST['new_name']
);
}
@ -153,10 +153,10 @@ if (isset($_REQUEST['submitoptions'])) {
}
}
if (! empty($_REQUEST['new_tbl_storage_engine'])
&& mb_strtoupper($_REQUEST['new_tbl_storage_engine']) !== $tbl_storage_engine
if (! empty($_POST['new_tbl_storage_engine'])
&& mb_strtoupper($_POST['new_tbl_storage_engine']) !== $tbl_storage_engine
) {
$new_tbl_storage_engine = mb_strtoupper($_REQUEST['new_tbl_storage_engine']);
$new_tbl_storage_engine = mb_strtoupper($_POST['new_tbl_storage_engine']);
if ($pma_table->isEngine('ARIA')) {
$create_options['transactional'] = (isset($create_options['transactional']) && $create_options['transactional'] == '0')
@ -195,30 +195,30 @@ if (isset($_REQUEST['submitoptions'])) {
$warning_messages = $operations->getWarningMessagesArray();
}
if (isset($_REQUEST['tbl_collation'])
&& ! empty($_REQUEST['tbl_collation'])
&& isset($_REQUEST['change_all_collations'])
&& ! empty($_REQUEST['change_all_collations'])
if (isset($_POST['tbl_collation'])
&& ! empty($_POST['tbl_collation'])
&& isset($_POST['change_all_collations'])
&& ! empty($_POST['change_all_collations'])
) {
$operations->changeAllColumnsCollation(
$GLOBALS['db'],
$GLOBALS['table'],
$_REQUEST['tbl_collation']
$_POST['tbl_collation']
);
}
}
/**
* Reordering the table has been requested by the user
*/
if (isset($_REQUEST['submitorderby']) && ! empty($_REQUEST['order_field'])) {
if (isset($_POST['submitorderby']) && ! empty($_POST['order_field'])) {
list($sql_query, $result) = $operations->getQueryAndResultForReorderingTable();
} // end if
/**
* A partition operation has been requested by the user
*/
if (isset($_REQUEST['submit_partition'])
&& ! empty($_REQUEST['partition_operation'])
if (isset($_POST['submit_partition'])
&& ! empty($_POST['partition_operation'])
) {
list($sql_query, $result) = $operations->getQueryAndResultForPartition();
} // end if

View File

@ -58,15 +58,15 @@ $insertEdit = new InsertEdit($GLOBALS['dbi']);
$insertEdit->isInsertRow();
$after_insert_actions = ['new_insert', 'same_insert', 'edit_next'];
if (isset($_REQUEST['after_insert'])
&& in_array($_REQUEST['after_insert'], $after_insert_actions)
if (isset($_POST['after_insert'])
&& in_array($_POST['after_insert'], $after_insert_actions)
) {
$url_params['after_insert'] = $_REQUEST['after_insert'];
if (isset($_REQUEST['where_clause'])) {
foreach ($_REQUEST['where_clause'] as $one_where_clause) {
if ($_REQUEST['after_insert'] == 'same_insert') {
$url_params['after_insert'] = $_POST['after_insert'];
if (isset($_POST['where_clause'])) {
foreach ($_POST['where_clause'] as $one_where_clause) {
if ($_POST['after_insert'] == 'same_insert') {
$url_params['where_clause'][] = $one_where_clause;
} elseif ($_REQUEST['after_insert'] == 'edit_next') {
} elseif ($_POST['after_insert'] == 'edit_next') {
$insertEdit->setSessionForEditNext($one_where_clause);
}
}
@ -147,7 +147,7 @@ $row_skipped = false;
$unsaved_values = [];
foreach ($loop_array as $rownumber => $where_clause) {
// skip fields to be ignored
if (! $using_key && isset($_REQUEST['insert_ignore_' . $where_clause])) {
if (! $using_key && isset($_POST['insert_ignore_' . $where_clause])) {
continue;
}
@ -156,47 +156,47 @@ foreach ($loop_array as $rownumber => $where_clause) {
// Map multi-edit keys to single-level arrays, dependent on how we got the fields
$multi_edit_columns
= isset($_REQUEST['fields']['multi_edit'][$rownumber])
? $_REQUEST['fields']['multi_edit'][$rownumber]
= isset($_POST['fields']['multi_edit'][$rownumber])
? $_POST['fields']['multi_edit'][$rownumber]
: [];
$multi_edit_columns_name
= isset($_REQUEST['fields_name']['multi_edit'][$rownumber])
? $_REQUEST['fields_name']['multi_edit'][$rownumber]
= isset($_POST['fields_name']['multi_edit'][$rownumber])
? $_POST['fields_name']['multi_edit'][$rownumber]
: [];
$multi_edit_columns_prev
= isset($_REQUEST['fields_prev']['multi_edit'][$rownumber])
? $_REQUEST['fields_prev']['multi_edit'][$rownumber]
= isset($_POST['fields_prev']['multi_edit'][$rownumber])
? $_POST['fields_prev']['multi_edit'][$rownumber]
: null;
$multi_edit_funcs
= isset($_REQUEST['funcs']['multi_edit'][$rownumber])
? $_REQUEST['funcs']['multi_edit'][$rownumber]
= isset($_POST['funcs']['multi_edit'][$rownumber])
? $_POST['funcs']['multi_edit'][$rownumber]
: null;
$multi_edit_salt
= isset($_REQUEST['salt']['multi_edit'][$rownumber])
? $_REQUEST['salt']['multi_edit'][$rownumber]
= isset($_POST['salt']['multi_edit'][$rownumber])
? $_POST['salt']['multi_edit'][$rownumber]
: null;
$multi_edit_columns_type
= isset($_REQUEST['fields_type']['multi_edit'][$rownumber])
? $_REQUEST['fields_type']['multi_edit'][$rownumber]
= isset($_POST['fields_type']['multi_edit'][$rownumber])
? $_POST['fields_type']['multi_edit'][$rownumber]
: null;
$multi_edit_columns_null
= isset($_REQUEST['fields_null']['multi_edit'][$rownumber])
? $_REQUEST['fields_null']['multi_edit'][$rownumber]
= isset($_POST['fields_null']['multi_edit'][$rownumber])
? $_POST['fields_null']['multi_edit'][$rownumber]
: null;
$multi_edit_columns_null_prev
= isset($_REQUEST['fields_null_prev']['multi_edit'][$rownumber])
? $_REQUEST['fields_null_prev']['multi_edit'][$rownumber]
= isset($_POST['fields_null_prev']['multi_edit'][$rownumber])
? $_POST['fields_null_prev']['multi_edit'][$rownumber]
: null;
$multi_edit_auto_increment
= isset($_REQUEST['auto_increment']['multi_edit'][$rownumber])
? $_REQUEST['auto_increment']['multi_edit'][$rownumber]
= isset($_POST['auto_increment']['multi_edit'][$rownumber])
? $_POST['auto_increment']['multi_edit'][$rownumber]
: null;
$multi_edit_virtual
= isset($_REQUEST['virtual']['multi_edit'][$rownumber])
? $_REQUEST['virtual']['multi_edit'][$rownumber]
= isset($_POST['virtual']['multi_edit'][$rownumber])
? $_POST['virtual']['multi_edit'][$rownumber]
: null;
// When a select field is nullified, it's not present in $_REQUEST
// When a select field is nullified, it's not present in $_POST
// so initialize it; this way, the foreach($multi_edit_columns) will process it
foreach ($multi_edit_columns_name as $key => $val) {
if (! isset($multi_edit_columns[$key])) {
@ -227,30 +227,31 @@ foreach ($loop_array as $rownumber => $where_clause) {
$filename = 'libraries/classes/Plugins/Transformations/'
. $mime_map[$column_name]['input_transformation'];
if (is_file($filename)) {
include_once $filename;
$classname = $transformations->getClassName($filename);
/** @var IOTransformationsPlugin $transformation_plugin */
$transformation_plugin = new $classname();
$transformation_options = $transformations->getOptions(
$mime_map[$column_name]['input_transformation_options']
);
$current_value = $transformation_plugin->applyTransformation(
$current_value,
$transformation_options
);
// check if transformation was successful or not
// and accordingly set error messages & insert_fail
if (method_exists($transformation_plugin, 'isSuccess')
&& !$transformation_plugin->isSuccess()
) {
$insert_fail = true;
$row_skipped = true;
$insert_errors[] = sprintf(
__('Row: %1$s, Column: %2$s, Error: %3$s'),
$rownumber,
$column_name,
$transformation_plugin->getError()
if (class_exists($classname)) {
/** @var IOTransformationsPlugin $transformation_plugin */
$transformation_plugin = new $classname();
$transformation_options = $transformations->getOptions(
$mime_map[$column_name]['input_transformation_options']
);
$current_value = $transformation_plugin->applyTransformation(
$current_value,
$transformation_options
);
// check if transformation was successful or not
// and accordingly set error messages & insert_fail
if (method_exists($transformation_plugin, 'isSuccess')
&& !$transformation_plugin->isSuccess()
) {
$insert_fail = true;
$row_skipped = true;
$insert_errors[] = sprintf(
__('Row: %1$s, Column: %2$s, Error: %3$s'),
$rownumber,
$column_name,
$transformation_plugin->getError()
);
}
}
}
}
@ -324,7 +325,7 @@ foreach ($loop_array as $rownumber => $where_clause) {
$query[] = 'UPDATE ' . Util::backquote($GLOBALS['table'])
. ' SET ' . implode(', ', $query_values)
. ' WHERE ' . $where_clause
. ($_REQUEST['clause_is_unique'] ? '' : ' LIMIT 1');
. ($_POST['clause_is_unique'] ? '' : ' LIMIT 1');
}
}
} // end foreach ($loop_array as $where_clause)
@ -349,7 +350,7 @@ unset(
// Builds the sql query
if ($is_insert && count($value_sets) > 0) {
$query = $insertEdit->buildSqlQuery($is_insertignore, $query_fields, $value_sets);
} elseif (empty($query) && ! isset($_REQUEST['preview_sql']) && !$row_skipped) {
} elseif (empty($query) && ! isset($_POST['preview_sql']) && !$row_skipped) {
// No change -> move back to the calling script
//
// Note: logic passes here for inline edit
@ -365,7 +366,7 @@ if ($is_insert && count($value_sets) > 0) {
unset($multi_edit_columns, $is_insertignore);
// If there is a request for SQL previewing.
if (isset($_REQUEST['preview_sql'])) {
if (isset($_POST['preview_sql'])) {
Core::previewSQL($query);
}
@ -425,11 +426,11 @@ if ($response->isAjax() && ! isset($_POST['ajax_page_request'])) {
* transformed fields, if they were edited. After that, output the correct
* link/transformed value and exit
*/
if (isset($_REQUEST['rel_fields_list']) && $_REQUEST['rel_fields_list'] != '') {
if (isset($_POST['rel_fields_list']) && $_POST['rel_fields_list'] != '') {
$map = $relation->getForeigners($db, $table, '', 'both');
$relation_fields = [];
parse_str($_REQUEST['rel_fields_list'], $relation_fields);
parse_str($_POST['rel_fields_list'], $relation_fields);
// loop for each relation cell
/** @var array $relation_fields */
@ -453,11 +454,11 @@ if ($response->isAjax() && ! isset($_POST['ajax_page_request'])) {
}
} // end of loop for each relation cell
}
if (isset($_REQUEST['do_transformations'])
&& $_REQUEST['do_transformations'] == true
if (isset($_POST['do_transformations'])
&& $_POST['do_transformations'] == true
) {
$edited_values = [];
parse_str($_REQUEST['transform_fields_list'], $edited_values);
parse_str($_POST['transform_fields_list'], $edited_values);
if (! isset($extra_data)) {
$extra_data = [];
@ -486,7 +487,7 @@ if ($response->isAjax() && ! isset($_POST['ajax_page_request'])) {
// Need to check the inline edited value can be truncated by MySQL
// without informing while saving
$column_name = $_REQUEST['fields_name']['multi_edit'][0][0];
$column_name = $_POST['fields_name']['multi_edit'][0][0];
$insertEdit->verifyWhetherValueCanBeTruncatedAndAppendExtraData(
$db,
@ -496,7 +497,7 @@ if ($response->isAjax() && ! isset($_POST['ajax_page_request'])) {
);
/**Get the total row count of the table*/
$_table = new Table($_REQUEST['table'], $_REQUEST['db']);
$_table = new Table($_POST['table'], $_POST['db']);
$extra_data['row_count'] = $_table->countRecords();
$extra_data['sql_query'] = Util::getMessage(
@ -527,8 +528,8 @@ $active_page = $goto_include;
* WHERE clause information so that tbl_change.php does not go back
* to the current record
*/
if (isset($_REQUEST['after_insert']) && 'new_insert' == $_REQUEST['after_insert']) {
unset($_REQUEST['where_clause']);
if (isset($_POST['after_insert']) && 'new_insert' == $_POST['after_insert']) {
unset($_POST['where_clause']);
}
/**

View File

@ -16,20 +16,20 @@ use PhpMyAdmin\Url;
*/
require_once 'libraries/common.inc.php';
if (isset($_REQUEST['submit_mult'])) {
$submit_mult = $_REQUEST['submit_mult'];
if (isset($_POST['submit_mult'])) {
$submit_mult = $_POST['submit_mult'];
// workaround for IE problem:
} elseif (isset($_REQUEST['submit_mult_delete_x'])) {
} elseif (isset($_POST['submit_mult_delete_x'])) {
$submit_mult = 'row_delete';
} elseif (isset($_REQUEST['submit_mult_change_x'])) {
} elseif (isset($_POST['submit_mult_change_x'])) {
$submit_mult = 'row_edit';
} elseif (isset($_REQUEST['submit_mult_export_x'])) {
} elseif (isset($_POST['submit_mult_export_x'])) {
$submit_mult = 'row_export';
}
// If the 'Ask for confirmation' button was pressed, this can only come
// from 'delete' mode, so we set it straight away.
if (isset($_REQUEST['mult_btn'])) {
if (isset($_POST['mult_btn'])) {
$submit_mult = 'row_delete';
}
@ -64,9 +64,9 @@ switch ($submit_mult) {
}
if (!empty($submit_mult)) {
if (isset($_REQUEST['goto'])
&& (! isset($_REQUEST['rows_to_delete'])
|| ! is_array($_REQUEST['rows_to_delete']))
if (isset($_POST['goto'])
&& (! isset($_POST['rows_to_delete'])
|| ! is_array($_POST['rows_to_delete']))
) {
$response = Response::getInstance();
$response->setRequestStatus(false);
@ -76,7 +76,7 @@ if (!empty($submit_mult)) {
switch ($submit_mult) {
/** @noinspection PhpMissingBreakStatementInspection */
case 'row_copy':
$_REQUEST['default_action'] = 'insert';
$_POST['default_action'] = 'insert';
// no break to allow for fallthough
case 'row_edit':
// As we got the rows to be edited from the
@ -84,10 +84,10 @@ if (!empty($submit_mult)) {
// indicating WHERE clause. Then we build the array which is used
// for the tbl_change.php script.
$where_clause = [];
if (isset($_REQUEST['rows_to_delete'])
&& is_array($_REQUEST['rows_to_delete'])
if (isset($_POST['rows_to_delete'])
&& is_array($_POST['rows_to_delete'])
) {
foreach ($_REQUEST['rows_to_delete'] as $i => $i_where_clause) {
foreach ($_POST['rows_to_delete'] as $i => $i_where_clause) {
$where_clause[] = $i_where_clause;
}
}
@ -104,10 +104,10 @@ if (!empty($submit_mult)) {
// indicating WHERE clause. Then we build the array which is used
// for the tbl_change.php script.
$where_clause = [];
if (isset($_REQUEST['rows_to_delete'])
&& is_array($_REQUEST['rows_to_delete'])
if (isset($_POST['rows_to_delete'])
&& is_array($_POST['rows_to_delete'])
) {
foreach ($_REQUEST['rows_to_delete'] as $i => $i_where_clause) {
foreach ($_POST['rows_to_delete'] as $i => $i_where_clause) {
$where_clause[] = $i_where_clause;
}
}
@ -120,7 +120,7 @@ if (!empty($submit_mult)) {
$action = 'tbl_row_action.php';
$err_url = 'tbl_row_action.php'
. Url::getCommon($GLOBALS['url_params']);
if (! isset($_REQUEST['mult_btn'])) {
if (! isset($_POST['mult_btn'])) {
$original_sql_query = $sql_query;
if (! empty($url_query)) {
$original_url_query = $url_query;
@ -136,7 +136,7 @@ if (!empty($submit_mult)) {
* Show result of multi submit operation
*/
// sql_query is not set when user does not confirm multi-delete
if ((! empty($submit_mult) || isset($_REQUEST['mult_btn']))
if ((! empty($submit_mult) || isset($_POST['mult_btn']))
&& ! empty($sql_query)
) {
$disp_message = __('Your SQL query has been executed successfully.');

View File

@ -46,8 +46,8 @@ $response->addHTML(
$sqlQueryForm->getHtml(
true,
false,
isset($_REQUEST['delimiter'])
? htmlspecialchars($_REQUEST['delimiter'])
isset($_POST['delimiter'])
? htmlspecialchars($_POST['delimiter'])
: ';'
)
);

View File

@ -28,10 +28,10 @@ $tracking = new Tracking();
if (Tracker::isActive()
&& Tracker::isTracked($GLOBALS["db"], $GLOBALS["table"])
&& ! (isset($_REQUEST['toggle_activation'])
&& $_REQUEST['toggle_activation'] == 'deactivate_now')
&& ! (isset($_REQUEST['report_export'])
&& $_REQUEST['export_type'] == 'sqldumpfile')
&& ! (isset($_POST['toggle_activation'])
&& $_POST['toggle_activation'] == 'deactivate_now')
&& ! (isset($_POST['report_export'])
&& $_POST['export_type'] == 'sqldumpfile')
) {
$msg = Message::notice(
sprintf(
@ -55,46 +55,46 @@ $selection_data = false;
$selection_both = false;
// Init vars for tracking report
if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) {
if (isset($_POST['report']) || isset($_POST['report_export'])) {
$data = Tracker::getTrackedData(
$_REQUEST['db'],
$_REQUEST['table'],
$_REQUEST['version']
$GLOBALS['db'],
$GLOBALS['table'],
$_POST['version']
);
if (! isset($_REQUEST['logtype'])) {
$_REQUEST['logtype'] = 'schema_and_data';
if (! isset($_POST['logtype'])) {
$_POST['logtype'] = 'schema_and_data';
}
if ($_REQUEST['logtype'] == 'schema') {
if ($_POST['logtype'] == 'schema') {
$selection_schema = true;
} elseif ($_REQUEST['logtype'] == 'data') {
} elseif ($_POST['logtype'] == 'data') {
$selection_data = true;
} else {
$selection_both = true;
}
if (! isset($_REQUEST['date_from'])) {
$_REQUEST['date_from'] = $data['date_from'];
if (! isset($_POST['date_from'])) {
$_POST['date_from'] = $data['date_from'];
}
if (! isset($_REQUEST['date_to'])) {
$_REQUEST['date_to'] = $data['date_to'];
if (! isset($_POST['date_to'])) {
$_POST['date_to'] = $data['date_to'];
}
if (! isset($_REQUEST['users'])) {
$_REQUEST['users'] = '*';
if (! isset($_POST['users'])) {
$_POST['users'] = '*';
}
$filter_ts_from = strtotime($_REQUEST['date_from']);
$filter_ts_to = strtotime($_REQUEST['date_to']);
$filter_users = array_map('trim', explode(',', $_REQUEST['users']));
$filter_ts_from = strtotime($_POST['date_from']);
$filter_ts_to = strtotime($_POST['date_to']);
$filter_users = array_map('trim', explode(',', $_POST['users']));
}
// Prepare export
if (isset($_REQUEST['report_export'])) {
if (isset($_POST['report_export'])) {
$entries = $tracking->getEntries($data, $filter_ts_from, $filter_ts_to, $filter_users);
}
// Export as file download
if (isset($_REQUEST['report_export'])
&& $_REQUEST['export_type'] == 'sqldumpfile'
if (isset($_POST['report_export'])
&& $_POST['export_type'] == 'sqldumpfile'
) {
$tracking->exportAsFileDownload($entries);
}
@ -104,10 +104,10 @@ $html = '<br/>';
/**
* Actions
*/
if (isset($_REQUEST['submit_mult'])) {
if (! empty($_REQUEST['selected_versions'])) {
if ($_REQUEST['submit_mult'] == 'delete_version') {
foreach ($_REQUEST['selected_versions'] as $version) {
if (isset($_POST['submit_mult'])) {
if (! empty($_POST['selected_versions'])) {
if ($_POST['submit_mult'] == 'delete_version') {
foreach ($_POST['selected_versions'] as $version) {
$tracking->deleteTrackingVersion($version);
}
$html .= Message::success(
@ -121,45 +121,45 @@ if (isset($_REQUEST['submit_mult'])) {
}
}
if (isset($_REQUEST['submit_delete_version'])) {
$html .= $tracking->deleteTrackingVersion($_REQUEST['version']);
if (isset($_POST['submit_delete_version'])) {
$html .= $tracking->deleteTrackingVersion($_POST['version']);
}
// Create tracking version
if (isset($_REQUEST['submit_create_version'])) {
if (isset($_POST['submit_create_version'])) {
$html .= $tracking->createTrackingVersion();
}
// Deactivate tracking
if (isset($_REQUEST['toggle_activation'])
&& $_REQUEST['toggle_activation'] == 'deactivate_now'
if (isset($_POST['toggle_activation'])
&& $_POST['toggle_activation'] == 'deactivate_now'
) {
$html .= $tracking->changeTracking('deactivate');
}
// Activate tracking
if (isset($_REQUEST['toggle_activation'])
&& $_REQUEST['toggle_activation'] == 'activate_now'
if (isset($_POST['toggle_activation'])
&& $_POST['toggle_activation'] == 'activate_now'
) {
$html .= $tracking->changeTracking('activate');
}
// Export as SQL execution
if (isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'execution') {
if (isset($_POST['report_export']) && $_POST['export_type'] == 'execution') {
$sql_result = $tracking->exportAsSqlExecution($entries);
$msg = Message::success(__('SQL statements executed.'));
$html .= $msg->getDisplay();
}
// Export as SQL dump
if (isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'sqldump') {
if (isset($_POST['report_export']) && $_POST['export_type'] == 'sqldump') {
$html .= $tracking->exportAsSqlDump($entries);
}
/*
* Schema snapshot
*/
if (isset($_REQUEST['snapshot'])) {
if (isset($_POST['snapshot'])) {
$html .= $tracking->getHtmlForSchemaSnapshot($url_query);
}
// end of snapshot report
@ -167,13 +167,13 @@ if (isset($_REQUEST['snapshot'])) {
/*
* Tracking report
*/
if (isset($_REQUEST['report'])
&& (isset($_REQUEST['delete_ddlog']) || isset($_REQUEST['delete_dmlog']))
if (isset($_POST['report'])
&& (isset($_POST['delete_ddlog']) || isset($_POST['delete_dmlog']))
) {
$html .= $tracking->deleteTrackingReportRows($data);
}
if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) {
if (isset($_POST['report']) || isset($_POST['report_export'])) {
$html .= $tracking->getHtmlForTrackingReport(
$url_query,
$data,
@ -187,7 +187,6 @@ if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) {
);
} // end of report
/*
* Main page
*/

View File

@ -45,25 +45,47 @@
{{ version.status_button|raw }}
</td>
<td>
<a class="delete_tracking_anchor ajax"
href="db_tracking.php{{ url_query|raw }}&amp;table=
{{- version.table_name }}&amp;delete_tracking=true">
<a class="delete_tracking_anchor ajax" href="db_tracking.php" data-post="
{{- get_common({
'db': db,
'goto': 'tbl_tracking.php',
'back': 'db_tracking.php',
'table': version.table_name,
'delete_tracking': true
}, '') }}">
{{ get_icon('b_drop', 'Delete tracking'|trans) }}
</a>
</td>
<td>
<a href="tbl_tracking.php{{ url_query|raw }}&amp;table=
{{- version.table_name }}">
<a href="tbl_tracking.php" data-post="
{{- get_common({
'db': db,
'goto': 'tbl_tracking.php',
'back': 'db_tracking.php',
'table': version.table_name
}, '') }}">
{{ get_icon('b_versions', 'Versions'|trans) }}
</a>
<a href="tbl_tracking.php{{ url_query|raw }}&amp;table=
{{- version.table_name }}&amp;report=true&amp;version=
{{- version.version }}">
<a href="tbl_tracking.php" data-post="
{{- get_common({
'db': db,
'goto': 'tbl_tracking.php',
'back': 'db_tracking.php',
'table': version.table_name,
'report': true,
'version': version.version
}, '') }}">
{{ get_icon('b_report', 'Tracking report'|trans) }}
</a>
<a href="tbl_tracking.php{{ url_query|raw }}&amp;table=
{{- version.table_name }}&amp;snapshot=true&amp;version=
{{- version.version }}">
<a href="tbl_tracking.php" data-post="
{{- get_common({
'db': db,
'goto': 'tbl_tracking.php',
'back': 'db_tracking.php',
'table': version.table_name,
'snapshot': true,
'version': version.version
}, '') }}">
{{ get_icon('b_props', 'Structure snapshot'|trans) }}
</a>
</td>

View File

@ -1,4 +1,4 @@
<form action="server_binlog.php" method="get">
<form action="server_binlog.php" method="post">
{{ get_hidden_inputs(url_params) }}
<fieldset>
<legend>

View File

@ -20,11 +20,10 @@
{% if criteria_values[column_index] is defined %}
value="{{ criteria_values[column_index] }}"
{% endif %} />
<a class="ajax browse_foreign"
href="browse_foreigners.php
{{- get_common({'db': db, 'table': table}) -}}
&amp;field={{ column_name|url_encode }}&amp;fieldkey=
{{- column_index }}&amp;fromsearch=1">
<a class="ajax browse_foreign" href="browse_foreigners.php" data-post="
{{- get_common({'db': db, 'table': table}, '') -}}
&amp;field={{ column_name|url_encode }}&amp;fieldkey=
{{- column_index }}&amp;fromsearch=1">
{{ titles['Browse']|replace({"'": "\\'"})|raw }}
</a>
{% endif %}

View File

@ -56,23 +56,27 @@
<td>{% trans 'not active' %}</td>
{% endif %}
<td>
<a class="delete_version_anchor ajax" href="tbl_tracking.php{{- url_query|raw -}}&version=
{{- version['version']|escape -}}&submit_delete_version=true">
<a class="delete_version_anchor ajax" href="tbl_tracking.php" data-post="
{{- get_common(url_params|merge({
'version': version['version'],
'submit_delete_version': true
}), '') }}">
{{ get_icon('b_drop', 'Delete version'|trans) }}
</a>
</td>
<td>
<a href="tbl_tracking.php
{{- get_common(
url_params|merge({'report': 'true', 'version': version['version']})
) -}}">
<a href="tbl_tracking.php" data-post="
{{- get_common(url_params|merge({
'version': version['version'],
'report': 'true'
}), '') }}">
{{ get_icon('b_report', 'Tracking report'|trans) }}
</a>
&nbsp;&nbsp;
<a href="tbl_tracking.php
{{- get_common(
url_params|merge({'snapshot': 'true', 'version': version['version']})
) -}}">
<a href="tbl_tracking.php" data-post="
{{- get_common(url_params|merge({
'version': version['version'],
'snapshot': 'true'
}), '') }}">
{{ get_icon('b_props', 'Structure snapshot'|trans) }}
</a>
</td>

View File

@ -16,7 +16,7 @@
<td><small>{{ entry.username }}</small></td>
<td>{{ entry.formated_statement|raw }}</td>
<td class="nowrap">
<a class="delete_entry_anchor ajax" href="tbl_tracking.php
<a class="delete_entry_anchor ajax" href="tbl_tracking.php" data-post="
{{- entry.url_params|raw }}">
{{ drop_image_or_text|raw }}
</a>

View File

@ -68,7 +68,7 @@ class BrowseForeignersTest extends TestCase
$this->browseForeigners->getForeignLimit(null)
);
$_REQUEST['pos'] = 10;
$_POST['pos'] = 10;
$this->assertEquals(
'LIMIT 10, 25 ',
@ -109,7 +109,7 @@ class BrowseForeignersTest extends TestCase
)
);
$_REQUEST['pos'] = 15;
$_POST['pos'] = 15;
$foreignData = [];
$foreignData['disp_row'] = [];
$foreignData['the_total'] = 5;
@ -198,8 +198,8 @@ class BrowseForeignersTest extends TestCase
$foreignData['disp_row'] = '';
$fieldkey = 'bar';
$current_value = '';
$_REQUEST['rownumber'] = 1;
$_REQUEST['foreign_filter'] = '5';
$_POST['rownumber'] = 1;
$_POST['foreign_filter'] = '5';
$result = $this->browseForeigners->getHtmlForRelationalFieldSelection(
$db,
$table,

View File

@ -231,8 +231,8 @@ class CentralColumnsTest extends TestCase
*/
public function testSyncUniqueColumns()
{
$_REQUEST['db'] = 'PMA_db';
$_REQUEST['table'] = 'PMA_table';
$_POST['db'] = 'PMA_db';
$_POST['table'] = 'PMA_table';
$this->assertTrue(
$this->centralColumns->syncUniqueColumns(
@ -248,8 +248,8 @@ class CentralColumnsTest extends TestCase
*/
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))

Some files were not shown because too many files have changed in this diff Show More