tag 325860 +patch thanks Hello, > > The PTS fails to quote get parameters when package names are inserted > > into links. > > As far as I can see, the only URL that doesn't currently work is the > "Patches from BTS" link, which definitely needs encoding as described. I've patched this against current CVS of the PTS; the patch fixes the encoding and adds selection for the right singular/plural form to use in the text (i.e., not 'patch(es)' and 'it(them)' but the right form for the right number). I don't have a working copy of the PTS so can't guarrantee that the patch is 100% correct, but it won't be far off. Thijs
Index: xsl/pts.xsl
===================================================================
RCS file: /cvs/qa/pts/www/xsl/pts.xsl,v
retrieving revision 1.59
diff -u -r1.59 pts.xsl
--- xsl/pts.xsl 19 Feb 2006 22:33:10 -0000 1.59
+++ xsl/pts.xsl 10 Mar 2006 19:30:31 -0000
@@ -507,7 +507,16 @@
</xsl:for-each>
<xsl:if test="$other/bugs/@patch!='0'">
<li>
- <a href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=src&data={$package}&include=patch&exclude=pending">Patches from BTS (<xsl:value-of select="$other/bugs/@patch"/>)</a>
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=src&data=</xsl:text>
+ <xsl:call-template name="escape-name">
+ <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
+ </xsl:call-template>
+ <xsl:text>&include=patch&exclude=pending</xsl:text>
+ </xsl:attribute>
+ Patches from BTS (<xsl:value-of select="$other/bugs/@patch"/>)
+ </xsl:element>
</li>
</xsl:if>
</ul>
@@ -738,7 +747,20 @@
(<xsl:value-of select="$other/watch/@new"/>). <a href="{$other/watch/@url}"><xsl:value-of select="$other/watch/@url"/></a></li>
</xsl:if>
<xsl:if test="$other/bugs/@patch!='0'">
- <li>The Bug Tracking System contains <a href="http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=src&data={$package}&include=patch&exclude=pending"><xsl:value-of select="$other/bugs/@patch"/> patch(es)</a>, you should include it(them).</li>
+ <li>The Bug Tracking System contains
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:text>http://bugs.debian.org/cgi-bin/pkgreport.cgi?which=src&data=</xsl:text>
+ <xsl:call-template name="escape-name">
+ <xsl:with-param name="text"><xsl:value-of select="$package"/></xsl:with-param>
+ </xsl:call-template>
+ <xsl:text>&include=patch&exclude=pending</xsl:text>
+ </xsl:attribute>
+ <xsl:value-of select="$other/bugs/@patch"/> patch<xsl:if test="$other/bugs/@patch!='1'">es</xsl:if>
+ </xsl:element>, you should include
+ <xsl:if test="$other/bugs/@patch!='1'">them</xsl:if>
+ <xsl:if test="$other/bugs/@patch='1'">it</xsl:if>.
+ </li>
</xsl:if>
</xsl:if>
</xsl:variable>
Attachment:
signature.asc
Description: This is a digitally signed message part