From 5809c672b7ea2ee183ffbc1761bbc88952b6ced7 Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Thu, 25 Feb 2010 19:20:28 +0000 Subject: [PATCH] Quote input used in URLs Signed-off-by: Adam D. Barratt Based on a patch to britney by Marc Brockschmidt --- britney.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/britney.py b/britney.py index c07788f..d6e611f 100755 --- a/britney.py +++ b/britney.py @@ -184,6 +184,7 @@ import time import copy import optparse import operator +import urllib import apt_pkg @@ -1292,10 +1293,10 @@ class Britney: if oodtxt: oodtxt = oodtxt + "; " oodtxt = oodtxt + "%s (from %s)" % \ - (", ".join(sorted(oodbins[v])), arch, src, v, v) + (", ".join(sorted(oodbins[v])), urllib.quote(arch), urllib.quote(src), urllib.quote(v), v) text = "out of date on %s: %s" % \ - (arch, src, source_u[VERSION], arch, oodtxt) + (urllib.quote(arch), urllib.quote(src), urllib.quote(source_u[VERSION]), arch, oodtxt) if arch in self.options.fucked_arches.split(): text = text + " (but %s isn't keeping up, so nevermind)" % (arch) @@ -1326,14 +1327,14 @@ class Britney: if len(new_bugs) > 0: excuse.addhtml("%s (%s) has new bugs!" % (pkg, ", ".join(pkgs[pkg]), pkg)) + "target=\"_blank\">has new bugs!" % (pkg, ", ".join(pkgs[pkg]), urllib.quote(pkg))) excuse.addhtml("Updating %s introduces new bugs: %s" % (pkg, ", ".join( - ["#%s" % (a, a) for a in new_bugs]))) + ["#%s" % (urllib.quote(a), a) for a in new_bugs]))) update_candidate = False if len(old_bugs) > 0: excuse.addhtml("Updating %s fixes old bugs: %s" % (pkg, ", ".join( - ["#%s" % (a, a) for a in old_bugs]))) + ["#%s" % (urllib.quote(a), a) for a in old_bugs]))) if len(old_bugs) > len(new_bugs) and len(new_bugs) > 0: excuse.addhtml("%s introduces new bugs, so still ignored (even " "though it fixes more than it introduces, whine at debian-release)" % pkg)