From e14640a19589c4dd87b3b6716ed233548026b26f Mon Sep 17 00:00:00 2001 From: LeonGaultier Date: Mon, 16 Sep 2019 06:19:34 +0000 Subject: [PATCH] 59_Weather: check newLocation value git-svn-id: https://svn.fhem.de/fhem/trunk@20169 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/59_Weather.pm | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 9748f4fd9..cca3fa762 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 59_Weather: check newLocation value - change: 49_SSCam: release unnecessary allocated memory - new: 70_SolarEdgeAPI: new module - bugfix: 74_AMADautomagicFlowset: fix openApp bug in SetCommand Flow diff --git a/fhem/FHEM/59_Weather.pm b/fhem/FHEM/59_Weather.pm index ff2eb87fe..dd63d4bb1 100755 --- a/fhem/FHEM/59_Weather.pm +++ b/fhem/FHEM/59_Weather.pm @@ -581,7 +581,10 @@ sub Weather_Set($@) { ($lat,$long) = split(',',$a[2]) if ( defined($a[2]) and $a[2] ); ($lat,$long) = split(',',$hash->{fhem}->{LOCATION}) - unless ( defined($lat) and defined($long) ); + unless ( defined($lat) + and defined($long) + and $lat =~ /(-?\d+(\.\d+)?)/ + and $long =~ /(-?\d+(\.\d+)?)/ ); $hash->{fhem}->{api}->setLocation($lat,$long); Weather_DisarmTimer($hash);