From c086bc8d6c9ca64cae5d3925ebfeb8f7a7cf212e Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Sun, 14 Mar 2021 09:44:41 +0000 Subject: [PATCH] HttpUtils.pm: fix dnsHostsFile search (Forum #119497) git-svn-id: https://svn.fhem.de/fhem/trunk@23965 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/HttpUtils.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fhem/FHEM/HttpUtils.pm b/fhem/FHEM/HttpUtils.pm index 2b9f276b1..4840e3fb3 100644 --- a/fhem/FHEM/HttpUtils.pm +++ b/fhem/FHEM/HttpUtils.pm @@ -251,7 +251,8 @@ HttpUtils_gethostbyname($$$$) my $fh; if(open($fh, $dh)) { while(my $line = <$fh>) { - if($line =~ m/^([^# \t]+).*\b\Q$host\E\b/) { + if($line =~ m/^([^#\s]+).*?\s\Q$host\E\s/ || + $line =~ m/^([^#\s]+).*?\s\Q$host\E$/) { if($1 =~ m/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ && # IP-Address $1<256 && $2<256 && $3<256 && $4<256) { $fn->($hash, undef, pack("CCCC", $1, $2, $3, $4));