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

Bug#780969: UDD: bugs: fix HTML bugs on sponsorstats



Package: qa.debian.org
Severity: minor
Tags: patch
User: qa.debian.org@packages.debian.org
Usertags: udd

Dear Maintainer,

I found some [errors][1] on sponsorstats web page.
I join the patch to fix that.

Cheers,
Laurent

[1]: https://validator.nu/?doc=https%3A%2F%2Fudd.debian.org%2Fsponsorstats.cgi

-- System Information:
Debian Release: 8.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to fr_FR.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
From 1a6595dd27da0264406c59960e2dbf0b9501095c Mon Sep 17 00:00:00 2001
From: Laurent Arnoud <laurent@spkdev.net>
Date: Sun, 22 Mar 2015 15:40:27 +0100
Subject: [PATCH] bugs: fix HTML bugs on sponsorstats

see https://validator.nu/?doc=https%3A%2F%2Fudd.debian.org%2Fsponsorstats.cgi
---
 web/sponsorstats.cgi | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/web/sponsorstats.cgi b/web/sponsorstats.cgi
index 2be34c6..0b17cc4 100755
--- a/web/sponsorstats.cgi
+++ b/web/sponsorstats.cgi
@@ -1,6 +1,7 @@
 #!/usr/bin/ruby
 
 require 'dbi'
+require 'cgi'
 
 puts "Content-type: text/html; charset=utf-8\n\n"
 
@@ -34,7 +35,8 @@ while row = sth.fetch do
   uploaders[row['login']][row['changed_by']] << [ row['source'], row['version'], row['nmu'] ]
 end
 
-puts "<html><body>"
+puts "<!DOCTYPE html><html><head><title>Sponsoring stats</title></head>"
+puts "<body>"
 puts "<h1>Sponsoring stats, powered by UDD!</h1>"
 puts "<p>Uploads in <b>bold</b> were NMUs.</p>"
 puts "<p>That excludes uploads done for people who are now DD, even if the upload was done while they were not DD.</p>"
@@ -48,7 +50,7 @@ uploaders.to_a.sort { |a,b| uploads[a[0]] <=> uploads[b[0]] }.reverse.each do |k
   puts "<li>#{rank}. #{k} -- #{names[k]} (#{uploads[k]} uploads)\n<ul>"
   v.to_a.sort { |a,b| a[1].length <=> b[1].length }.reverse.each do |k2|
     k2, v = k2
-    puts "<li>#{k2} (#{v.length} uploads)\n<ul>"
+    puts "<li>#{CGI.escapeHTML(k2)} (#{v.length} uploads)\n<ul>"
     v.each do |u|
       if u[2]
         puts "<li><b>#{u[0]} #{u[1]}</b></li>"
-- 
2.1.4

Attachment: signature.asc
Description: Digital signature


Reply to: