Skip to content
Permalink
Browse files

Retrieve parameters from $_POST in GIS data editor

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
  • Loading branch information...
mauriciofauth committed Aug 30, 2018
1 parent 737ac99 commit 0fe1a3bea88a553407930f83380b88d7591d2bdd
Showing with 16 additions and 16 deletions.
  1. +16 −16 gis_data_editor.php
@@ -27,14 +27,14 @@ function escape($variable)
require_once 'libraries/common.inc.php';
if (! isset($_REQUEST['field'])) {
if (! isset($_POST['field'])) {
PhpMyAdmin\Util::checkParameters(array('field'));
}
// Get data if any posted
$gis_data = array();
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 = array(
@@ -50,15 +50,15 @@ function escape($variable)
// 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']))
@@ -71,9 +71,9 @@ function escape($variable)
// 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_data, $gis_obj->generateParams($_POST['value'])
);
}
@@ -98,7 +98,7 @@ function escape($variable)
->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 = array(
'result' => $result,
'visualization' => $visualization,
@@ -119,17 +119,17 @@ function escape($variable)
echo '<h3>';
printf(
__('Value for the column "%s"'),
htmlspecialchars($_REQUEST['field'])
htmlspecialchars($_POST['field'])
);
echo '</h3>';
echo '<input type="hidden" name="field" value="'
, htmlspecialchars($_REQUEST['field']) , '" />';
, htmlspecialchars($_POST['field']) , '" />';
// The input field to which the final result should be added
// and corresponding null checkbox
if (isset($_REQUEST['input_name'])) {
if (isset($_POST['input_name'])) {
echo '<input type="hidden" name="input_name" value="'
, htmlspecialchars($_REQUEST['input_name']) , '" />';
, htmlspecialchars($_POST['input_name']) , '" />';
}
echo Url::getHiddenInputs();

0 comments on commit 0fe1a3b

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