From 9bdb7c562aec8be2f3c1f3ab5d306f7540e5a284 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Fri, 10 Apr 2015 14:51:07 +0200 Subject: [PATCH] helper/has_location: validate coordinates (+-90, +-180) --- helper.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helper.js b/helper.js index a4d29fa..dd326e5 100644 --- a/helper.js +++ b/helper.js @@ -84,7 +84,9 @@ function online(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) {