Quit using filter_input since they bypass token check
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
This commit is contained in:
parent
31c21b070a
commit
0f76d59e1e
@ -10,7 +10,7 @@ if (!defined('PHPMYADMIN')) {
|
||||
}
|
||||
// build user preferences menu
|
||||
|
||||
$form_param = filter_input(INPUT_GET, 'form');
|
||||
$form_param = isset($_GET['form']) ? $_GET['form'] : null;
|
||||
if (! isset($forms[$form_param])) {
|
||||
$forms_keys = array_keys($forms);
|
||||
$form_param = array_shift($forms_keys);
|
||||
|
||||
@ -23,7 +23,7 @@ PMA_userprefsPageInit($cf);
|
||||
|
||||
// handle form processing
|
||||
|
||||
$form_param = filter_input(INPUT_GET, 'form');
|
||||
$form_param = isset($_GET['form']) ? $_GET['form'] : null;
|
||||
if (! isset($forms[$form_param])) {
|
||||
$forms_keys = array_keys($forms);
|
||||
$form_param = array_shift($forms_keys);
|
||||
@ -57,7 +57,8 @@ if ($form_display->process(false) && !$form_display->hasErrors()) {
|
||||
if ($result === true) {
|
||||
// reload config
|
||||
$GLOBALS['PMA_Config']->loadUserPreferences();
|
||||
$hash = ltrim(filter_input(INPUT_POST, 'tab_hash'), '#');
|
||||
$tabHash = isset($_POST['tab_hash']) ? $_POST['tab_hash'] : null;
|
||||
$hash = ltrim($tabHash, '#');
|
||||
PMA_userprefsRedirect(
|
||||
'prefs_forms.php',
|
||||
array('form' => $form_param),
|
||||
|
||||
@ -23,7 +23,8 @@ PMA_userprefsPageInit($cf);
|
||||
|
||||
$error = '';
|
||||
if (isset($_POST['submit_export'])
|
||||
&& filter_input(INPUT_POST, 'export_type') == 'text_file'
|
||||
&& isset($_POST['export_type'])
|
||||
&& $_POST['export_type'] == 'text_file'
|
||||
) {
|
||||
// export to JSON file
|
||||
PMA_Response::getInstance()->disable();
|
||||
@ -41,7 +42,8 @@ if (isset($_POST['submit_export'])
|
||||
} else if (isset($_POST['submit_import'])) {
|
||||
// load from JSON file
|
||||
$json = '';
|
||||
if (filter_input(INPUT_POST, 'import_type') == 'text_file'
|
||||
if (isset($_POST['import_type'])
|
||||
&& $_POST['import_type'] == 'text_file'
|
||||
&& isset($_FILES['import_file'])
|
||||
&& $_FILES['import_file']['error'] == UPLOAD_ERR_OK
|
||||
&& is_uploaded_file($_FILES['import_file']['tmp_name'])
|
||||
@ -70,14 +72,14 @@ if (isset($_POST['submit_export'])
|
||||
}
|
||||
} else {
|
||||
// read from POST value (json)
|
||||
$json = filter_input(INPUT_POST, 'json');
|
||||
$json = isset($_POST['json']) ? $_POST['json'] : null;
|
||||
}
|
||||
|
||||
// hide header message
|
||||
$_SESSION['userprefs_autoload'] = true;
|
||||
|
||||
$config = json_decode($json, true);
|
||||
$return_url = filter_input(INPUT_POST, 'return_url');
|
||||
$return_url = isset($_POST['return_url']) ? $_POST['return_url'] : null;
|
||||
if (! is_array($config)) {
|
||||
$error = __('Could not import configuration');
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user