Allow space in icon names

git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@2576 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2013-01-27 10:28:59 +00:00
parent 49356364b3
commit 43ba66196e
2 changed files with 9 additions and 1 deletions

View File

@@ -447,7 +447,7 @@ FW_answerCall($)
return FW_serveSpecial($1, "js", $FW_jsdir, 1);
} elsif($arg =~ m,^$FW_ME/icons/(.*)$,) {
my ($icon,$cacheable) = ($1, 1);
my ($icon,$cacheable) = (urlDecode($1), 1);
#Debug "You want $icon which is " . $FW_icons{$icon};
# if we do not have the icon, we convert the device state to the icon name
$icon =~ s/\.($ICONEXTENSION)$//;

View File

@@ -42,6 +42,14 @@ urlEncode($) {
return $_;
}
##################
sub
urlDecode($) {
$_= $_[0];
s/%([0-9A-F][0-9A-F])/chr(hex($1))/egi;
return $_;
}
##################
# - if data (which is urlEncoded) is set, then a POST is performed, else a GET.
# - noshutdown must be set for e.g the Fritz!Box