Fixed regex for negative lat+lng

This commit is contained in:
Mike Rostermund
2015-11-30 21:00:22 +01:00
parent ea41f8b887
commit 3467fc8a86

View File

@@ -802,7 +802,7 @@ function ceph_rrd($gtype) {
* @return array Containing the lat and lng coords
**/
function parse_location($location) {
preg_match('/(\[)([0-9\. ]+),[ ]*([0-9\. ]+)(\])/', $location, $tmp_loc);
preg_match('/(\[)(-?[0-9\. ]+),[ ]*(-?[0-9\. ]+)(\])/', $location, $tmp_loc);
if (!empty($tmp_loc[2]) && !empty($tmp_loc[3])) {
return array('lat' => $tmp_loc[2], 'lng' => $tmp_loc[3]);
}