2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

98_GEOFANCY: fix validation for lat+long

git-svn-id: https://svn.fhem.de/fhem/trunk@10449 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2016-01-10 18:32:47 +00:00
parent 765a2fa4cc
commit b768b29205

View File

@ -274,7 +274,7 @@ m/(19|20)\d\d-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):([0-5
)
if (
defined $webArgs->{latitude}
&& ( $webArgs->{latitude} !~ m/^[0-9]+([.][0-9]+)?$/
&& ( $webArgs->{latitude} !~ m/^-?\d+(\.\d+)?$/
|| $webArgs->{latitude} < -90
|| $webArgs->{latitude} > 90 )
);
@ -288,7 +288,7 @@ m/(19|20)\d\d-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([0-1][0-9]|2[0-3]):([0-5
)
if (
defined $webArgs->{longitude}
&& ( $webArgs->{longitude} !~ m/^[0-9]+([.][0-9]+)?$/
&& ( $webArgs->{longitude} !~ m/^-?\d+(\.\d+)?$/
|| $webArgs->{longitude} < -180
|| $webArgs->{longitude} > 180 )
);