From: Ian Jackson Subject: [OSSTEST PATCH 07/13] Reporting: report_run_getinfo produces Content Date: Mon, 29 Jun 2015 18:14:43 +0100 Message-ID: <1435598089-21647-8-git-send-email-ian.jackson@eu.citrix.com> References: <1435598089-21647-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z9cu8-00005F-1v for xen-devel@lists.xenproject.org; Mon, 29 Jun 2015 17:31:36 +0000 In-Reply-To: <1435598089-21647-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org 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 --- 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 "$jr->{job}\n"; my $ri = report_run_getinfo({ %$jr, %$ir }); - print H "{ColourAttr}>$ri->{Summary}\n"; + print H "{ColourAttr}>$ri->{Content}\n"; print H "\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 "".encode_entities($r->{Flight}{branch})."\n"; $url= "$c{ReportHtmlPubBaseUrl}/$flt/".encode_entities($j)."/"; print H "{ColourAttr}>". - encode_entities($r->{Summary})."\n"; + $r->{Content}."\n"; my $lastrev; my $hosts = join ", ", map { $_ // "-" } @{ $r->{Hosts} }; print H "".encode_entities($hosts)."\n"; -- 1.7.10.4