From f9346ea0e5cf5dcad80616468f951d45c85c6296 Mon Sep 17 00:00:00 2001 From: herrmannj <> Date: Tue, 6 Jun 2023 20:03:18 +0000 Subject: [PATCH] 98_JsonMod.pm: modify file uri behaviour (Forum #133765 git-svn-id: https://svn.fhem.de/fhem/trunk@27660 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_JsonMod.pm | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/98_JsonMod.pm b/fhem/FHEM/98_JsonMod.pm index d038a3ead..b71e67d0f 100644 --- a/fhem/FHEM/98_JsonMod.pm +++ b/fhem/FHEM/98_JsonMod.pm @@ -594,12 +594,15 @@ sub JsonMod_ApiRequest { my $source = $hash->{'CONFIG'}->{'SOURCE'}; - # file: correct file:/.. but also accepted file://.. - if ($source =~ m/^file:[\/]{1,2}(.+)/) { + # abs: file:/// or file:/ + # rel: file: + # non-comform file:// -> rel file: + if ($source =~ m/^file:[\/]{2}(.+)|^file:(.+)/) { $hash->{'CONFIG'}->{'IN_REQUEST'} = 0; $hash->{'API_LAST_RES'} = Time::HiRes::time(); - - my $filename = $1; + + my $filename = $1//$2; + # say "filename: $filename"; if (-e $filename) { my $data; open(my $fh, '<', $filename) or do { @@ -1889,7 +1892,16 @@ sub listDates {