diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index b24ebd9fc..0ddb87512 100644 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -1100,18 +1100,11 @@ FW_addContent(;$) sub FW_addLinks($) { - return undef if(!defined($_[0])); - my @lines = split( /\n/, $_[0]); # Adding links - my $ret = ""; - foreach my $line (@lines) { - $ret .= "\n" if( $ret ); - foreach my $word ( split( / /, $line ) ) { - $word = "$word" - if( $defs{$word} ); - $ret .= "$word "; - } - } - return $ret; + my ($txt) = @_; + return undef if(!defined($txt)); + $txt =~ s,\s([a-z0-9._]+)\s, + $defs{$1} ? "$1" : $1,gei; + return $txt; } diff --git a/fhem/FHEM/98_SVG.pm b/fhem/FHEM/98_SVG.pm index ce76e4dc5..d4ca7028f 100644 --- a/fhem/FHEM/98_SVG.pm +++ b/fhem/FHEM/98_SVG.pm @@ -27,6 +27,7 @@ use vars qw(%FW_webArgs); # all arguments specified in the GET use vars qw($FW_formmethod); use vars qw($FW_userAgent); use vars qw($FW_hiddenroom); +use vars qw($FW_CSRF); my $SVG_RET; # Returned data (SVG) sub SVG_calcOffsets($$); @@ -364,7 +365,8 @@ SVG_PEdit($$$$) return "" if( $pe eq 'never' ); - my $gp = "$FW_gplotdir/$defs{$d}{GPLOTFILE}.gplot"; + my $gpf = $defs{$d}{GPLOTFILE}; + my $gp = "$FW_gplotdir/$gpf.gplot"; my $pm = AttrVal($d,"plotmode",$FW_plotmode); my ($err, $cfg, $plot, $srcDesc) = SVG_readgplotfile($d, $gp, $pm); @@ -561,10 +563,15 @@ SVG_PEdit($$$$) e.preventDefault(); EOF $ret .= - "FW_cmd('$sl', function(arg){" .<<'EOF'; + "FW_cmd('$sl', function(arg){" .<<"EOF"; FW_okDialog(arg); }); }); + setTimeout(function(){ + \$("table.internals div[informid=$gpf-GPLOTFILE]").each(function(){ + \$(this).html( + "$gpf"); + }) }, 10); EOF return $ret;