Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a6ae247

Browse files
committed
Validate parameters before use
Signed-off-by: Michal Čihař <[email protected]>
1 parent 897a844 commit a6ae247

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

gis_data_editor.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ function escape($variable)
2323
require_once 'libraries/gis/GIS_Factory.class.php';
2424
require_once 'libraries/gis/GIS_Visualization.class.php';
2525

26+
if (! isset($_REQUEST['field'])) {
27+
PMA_Util::checkParameters(array('field'));
28+
}
29+
2630
// Get data if any posted
2731
$gis_data = array();
2832
if (PMA_isValid($_REQUEST['gis_data'], 'array')) {
@@ -185,6 +189,9 @@ function escape($variable)
185189
}
186190

187191
for ($a = 0; $a < $geom_count; $a++) {
192+
if (! isset($gis_data[$a])) {
193+
continue;
194+
}
188195

189196
if ($geom_type == 'GEOMETRYCOLLECTION') {
190197
echo '<br/><br/>';

0 commit comments

Comments
 (0)