forked from freifunk-franken/VPNkeyXchange
Allow numeric and empty coordinates
Unconfigured routers are sending empty coordinates to recieve the trainstation data. Signed-off-by: Robert Langhammer <rlanghammer@web.de>
This commit is contained in:
parent
4e1376ce2e
commit
c3100899bf
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
$lat = $_GET['lat'] ?? null;
|
||||
$lo = $_GET['long'] ?? null;
|
||||
$hoodid = $_GET['hoodid'] ?? null;
|
||||
|
||||
if (empty($hoodid)) {
|
||||
if (preg_match("/^[0-9.]*$/", $lat) and preg_match("/^[0-9.]*$/", $lo)) {
|
||||
$hoodfile = shell_exec("./get_hood.sh $lat $lo");
|
||||
}
|
||||
else {
|
||||
echo "coordinates not numeric! ";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ((!is_numeric($hoodid))) {exit("hoodid not numeric!");};
|
||||
$hoodfile = shell_exec("./get_hoodid.sh $hoodid");
|
||||
}
|
||||
echo $hoodfile;
|
||||
?>
|
Loading…
Reference in New Issue