diff --git a/html/includes/common/worldmap.inc.php b/html/includes/common/worldmap.inc.php index fe48d23b24..e914edb8ea 100644 --- a/html/includes/common/worldmap.inc.php +++ b/html/includes/common/worldmap.inc.php @@ -177,7 +177,7 @@ var greenMarker = L.AwesomeMarkers.icon({ $icon = 'greenMarker'; $z_offset = 0; $tmp_loc = parse_location($map_devices['location']); - if (!empty($tmp_loc['lat']) && !empty($tmp_loc['lng'])) { + if (is_numeric($tmp_loc['lat']) && is_numeric($tmp_loc['lng'])) { $map_devices['lat'] = $tmp_loc['lat']; $map_devices['lng'] = $tmp_loc['lng']; } diff --git a/includes/common.php b/includes/common.php index 536e2b5468..5497657a65 100644 --- a/includes/common.php +++ b/includes/common.php @@ -1073,7 +1073,7 @@ function ceph_rrd($gtype) function parse_location($location) { preg_match('/(\[)(-?[0-9\. ]+),[ ]*(-?[0-9\. ]+)(\])/', $location, $tmp_loc); - if (!empty($tmp_loc[2]) && !empty($tmp_loc[3])) { + if (is_numeric($tmp_loc[2]) && is_numeric($tmp_loc[3])) { return array('lat' => $tmp_loc[2], 'lng' => $tmp_loc[3]); } }//end parse_location()