Skip to content

Commit

Permalink
Merge pull request #2524 from SaaldjorMike/fix-parse-neg-latlng
Browse files Browse the repository at this point in the history
Fixed regex for negative lat+lng
  • Loading branch information
laf committed Nov 30, 2015
2 parents 0deb98e + 3467fc8 commit 1f1b0cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/common.php
Expand Up @@ -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]);
}
Expand Down

0 comments on commit 1f1b0cc

Please sign in to comment.