From 3467fc8a868b5051ea6ca4dc4e8adc7df6741356 Mon Sep 17 00:00:00 2001 From: Mike Rostermund Date: Mon, 30 Nov 2015 21:00:22 +0100 Subject: [PATCH] Fixed regex for negative lat+lng --- includes/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/common.php b/includes/common.php index 3d1f8a76e9..de68cfd788 100644 --- a/includes/common.php +++ b/includes/common.php @@ -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]); }