OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [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 <mst@redhat.com>
---
 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



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]