98_SVG.pm: fix crash when the link contains a dot (Forum #79431)

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@15563 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-12-07 08:21:06 +00:00
parent 35a47a07ba
commit 512918b303

View File

@ -366,6 +366,8 @@ SVG_PEdit($$$$)
return "" if( $pe eq 'never' ); return "" if( $pe eq 'never' );
my $gpf = $defs{$d}{GPLOTFILE}; my $gpf = $defs{$d}{GPLOTFILE};
my $gpfEsc = $gpf;
$gpfEsc =~ s,\.,\\\\.,g;
my $link = "$FW_ME?cmd=style edit $gpf.gplot". my $link = "$FW_ME?cmd=style edit $gpf.gplot".
(configDBUsed() ? " configDB" : "").$FW_CSRF; (configDBUsed() ? " configDB" : "").$FW_CSRF;
my $gp = "$FW_gplotdir/$gpf.gplot"; my $gp = "$FW_gplotdir/$gpf.gplot";
@ -570,9 +572,9 @@ EOF
}); });
}); });
setTimeout(function(){ setTimeout(function(){
\$("table.internals div[informid=$gpf-GPLOTFILE]").each(function(){ \$("table.internals div[informid=$gpfEsc-GPLOTFILE]")
\$(this).html("<a href='$link'>$gpf</a>"); .html("<a href='$link'>$gpf</a>");
}) }, 10); }, 10);
</script> </script>
EOF EOF
return $ret; return $ret;