01_FHEMWEB.pm: more precise FWEXT checking to allow subdirectories for FWEXT. Forum #32103.

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@7564 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2015-01-14 16:51:55 +00:00
parent 254b0723ea
commit 3cf2653926

View File

@@ -504,8 +504,11 @@ FW_answerCall($)
# /icons/... => current state of ... # /icons/... => current state of ...
# also used for static images: unintended, but too late to change # 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); my $iconPath = FW_iconPath($icon);
# if we do not have the icon, we convert the device state to the icon name # if we do not have the icon, we convert the device state to the icon name
@@ -518,8 +521,9 @@ FW_answerCall($)
$iconPath =~ m/(.*)\.([^.]*)/; $iconPath =~ m/(.*)\.([^.]*)/;
return FW_serveSpecial($1, $2, $FW_icondir, $cacheable); return FW_serveSpecial($1, $2, $FW_icondir, $cacheable);
} elsif($arg =~ m,^$FW_ME/(.*)/([^/]*)$, && !$data{FWEXT}{"/$1"}) { } elsif($dir1 && !$data{FWEXT}{"/$dir1"}) {
my ($dir, $ofile, $ext) = ($1, $2, ""); my $dir = "$dir1$dirN";
my $ext = "";
$dir =~ s/\.\.//g; $dir =~ s/\.\.//g;
$dir =~ s,www/,,g; # Want commandref.html to work from file://... $dir =~ s,www/,,g; # Want commandref.html to work from file://...