helper/has_location: validate coordinates (+-90, +-180)

This commit is contained in:
Nils Schneider 2015-04-10 14:51:07 +02:00
parent 020ab2aef5
commit 9bdb7c562a

View File

@ -84,7 +84,9 @@ function online(d) {
} }
function has_location(d) { function has_location(d) {
return "location" in d.nodeinfo return "location" in d.nodeinfo &&
Math.abs(d.nodeinfo.location.latitude) < 90 &&
Math.abs(d.nodeinfo.location.longitude) < 180
} }
function subtract(a, b) { function subtract(a, b) {