Sanitize Location string (#5589)

This commit is contained in:
Richard Mayhew
2017-01-26 10:11:11 +02:00
committed by Neil Lathwood
parent bed627975d
commit 08edfc60e0

View File

@@ -489,6 +489,7 @@ function location_to_latlng($device)
$device_location = $device['location'];
if (!empty($device_location)) {
$new_device_location = preg_replace("/ /", "+", $device_location);
$new_device_location = preg_replace('/[^A-Za-z0-9\-\+]/', '', $device_location); // Removes special chars.
// We have a location string for the device.
$loc = parse_location($device_location);
if (!is_array($loc)) {