From f32751739ba8d18ef1a4427eb00f316aa0d27a75 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Wed, 14 Jan 2015 16:51:55 +0000 Subject: [PATCH] 01_FHEMWEB.pm: more precise FWEXT checking to allow subdirectories for FWEXT. Forum #32103. git-svn-id: https://svn.fhem.de/fhem/trunk@7564 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/01_FHEMWEB.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index 058c70995..6e82874f4 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -504,8 +504,11 @@ FW_answerCall($) # /icons/... => current state of ... # also used for static images: unintended, but too late to change - if($arg =~ m,^$FW_ME/icons/(.*)$,) { - my ($icon,$cacheable) = (urlDecode($1), 1); + + my ($dir1, $dirN, $ofile) = ($1, $2, $3) + if($arg =~ m,^$FW_ME/([^/]*)(.*/)([^/]*)$,); + if($dir1 && $dir1 eq "icons") { + my ($icon,$cacheable) = (urlDecode($ofile), 1); my $iconPath = FW_iconPath($icon); # if we do not have the icon, we convert the device state to the icon name @@ -518,8 +521,9 @@ FW_answerCall($) $iconPath =~ m/(.*)\.([^.]*)/; return FW_serveSpecial($1, $2, $FW_icondir, $cacheable); - } elsif($arg =~ m,^$FW_ME/(.*)/([^/]*)$, && !$data{FWEXT}{"/$1"}) { - my ($dir, $ofile, $ext) = ($1, $2, ""); + } elsif($dir1 && !$data{FWEXT}{"/$dir1"}) { + my $dir = "$dir1$dirN"; + my $ext = ""; $dir =~ s/\.\.//g; $dir =~ s,www/,,g; # Want commandref.html to work from file://...