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

[Xen-devel] [OSSTEST PATCH 07/13] Reporting: report_run_getinfo produces Content



Previously we produced Summary, and the call sites were confused about
whether it had already been html-escaped.  Now we produce something
which is explicitly already html.

No functional change except that some sg-report-host-history output is
escaped as it ought to have been (but this is only relevant if the
database contains strange things which none of ours do).

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 Osstest/Executive.pm   |    3 ++-
 sg-report-host-history |    2 +-
 sg-report-job-history  |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm
index f53d271..9df4d91 100644
--- a/Osstest/Executive.pm
+++ b/Osstest/Executive.pm
@@ -32,6 +32,7 @@ use IO::Handle;
 use JSON;
 use File::Basename;
 use IO::Socket::INET;
+use HTML::Entities;
 #use Data::Dumper;
 
 use Osstest;
@@ -206,7 +207,7 @@ sub report_run_getinfo ($) {
     my $single = sub {
        my ($summary, $colour) = @_;
        return {
-           Summary => $summary,
+           Content => encode_entities($summary),
            ColourAttr => " bgcolor=\"$colour\"",
        };
     };
diff --git a/sg-report-host-history b/sg-report-host-history
index 9e3edf7..d4e5dea 100755
--- a/sg-report-host-history
+++ b/sg-report-host-history
@@ -242,7 +242,7 @@ END
        print H "<td><a href=\"$url\">$jr->{job}</td>\n";
 
        my $ri = report_run_getinfo({ %$jr, %$ir });
-       print H "<td $ri->{ColourAttr}>$ri->{Summary}</td>\n";
+       print H "<td $ri->{ColourAttr}>$ri->{Content}</td>\n";
 
        print H "</tr>\n\n";
        $alternate ^= 1;
diff --git a/sg-report-job-history b/sg-report-job-history
index 82713d3..a932c78 100755
--- a/sg-report-job-history
+++ b/sg-report-job-history
@@ -235,7 +235,7 @@ END
             print H "<td>".encode_entities($r->{Flight}{branch})."</td>\n";
             $url= "$c{ReportHtmlPubBaseUrl}/$flt/".encode_entities($j)."/";
             print H "<td $r->{ColourAttr}><a href=\"$url\">".
-                encode_entities($r->{Summary})."</a></td>\n";
+                $r->{Content}."</a></td>\n";
             my $lastrev;
             my $hosts = join ", ", map { $_ // "-" } @{ $r->{Hosts} };
             print H "<td>".encode_entities($hosts)."</td>\n";
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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