← Prev in month ← Prev in thread
Next in thread → Next in month →

[PATCH] admin: escape html special characters

From
Michael S. Tsirkin <>
Date
2021-04-06T11:41:00+00:00
ID
Thread
[PATCH] admin: escape html special characters
Ballot system needs the five HTML special characters to be escaped: "'&<> .  We don't usually have these but sometimes we do. Support that.  Signed-off-by: Michael S. Tsirkin <> ---  virtio-ballot.pl
6 ++++++  1 file changed, 6 insertions(+)  diff --git a/virtio-ballot.pl b/virtio-ballot.pl index e78bb44..b35e9f4 100755 --- a/virtio-ballot.pl +++ b/virtio-ballot.pl @@ -22,6 +22,12 @@ my $DESCRIPTION=$ARGV[2];  $DESCRIPTION =~ s/^s*//;  $DESCRIPTION =~ s/s*$//;
+$DESCRIPTION =~ s/&/&amp;/sg; +$DESCRIPTION =~ s/</&lt;/sg; +$DESCRIPTION =~ s/>/&gt;/sg; +$DESCRIPTION =~ s/"/&quot;/sg; +$DESCRIPTION =~ s/'/&apos;/sg; +  {  	package RC;  	for my $file ("$ENV{HOME}/.virtio-tc-rc")

--
MST
← Prev in month ← Prev in thread
Next in thread → Next in month →