[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 47/60] history reporting (nfc): Break out url_quote


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2020 18:21:52 +0100
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 14 Aug 2020 17:27:14 +0000
  • Ironport-sdr: W0PWBOGcTaOh5PxF3EZHPnw60gTjk5P744aQzgHSdUZ9MmyDCS2OFSUwCRJdLgyDSNRire5bPW SpBE8KyJ5swUsmKC5n5EA79AnNS7BWpodpwJZ+mvQo9WUL3zn5jyO0w7299UEZI8UBq/Be0RQf vc5UQf4qSkjf/s1UDEkpEi0eYJYFkITn55SYQ5e5txpYtPNKkux9/MxwqaNNzGSpCfhQSa3OOh odA77Gl3CuVaOtmq6rlk/R7HGmkG/x/eRwJBcVEvUsCE6rRDqym7sIM6QmzuWhxpe9iKbCB5xP LZM=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/HistoryReport.pm | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Osstest/HistoryReport.pm b/Osstest/HistoryReport.pm
index bfbee28c..f30ded5b 100644
--- a/Osstest/HistoryReport.pm
+++ b/Osstest/HistoryReport.pm
@@ -156,6 +156,12 @@ sub cache_read_previous ($) {
     close H;
 }
 
+sub url_quote ($) {
+    local ($_) = "$_[0]";
+    s{[^-+=/~:;_.,\w]}{ sprintf "%%%02x", ord $& }ge;
+    $_;
+}
+
 sub cache_row_lookup_prep ($) {
     my ($jrr) = @_;
 
@@ -179,8 +185,7 @@ sub cache_write_entry ($$) {
            next if $k =~ m/^\%/;
            $_ = $h->{$k};
            next unless defined;
-           s{[^-+=/~:;_.,\w]}{ sprintf "%%%02x", ord $& }ge;
-           printf $fh " %s=%s", $k, $_;
+           printf $fh " %s=%s", $k, url_quote($_);
        }
     };
     $whash->($jr);
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.