Bugzilla – Attachment 81053 Details for
Bug 14716
Correctly URI-encode URLs in XSLT result lists and detail pages
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14716: URI-encode URLs in UNIMARC xsl templates.
Bug-14716-URI-encode-URLs-in-UNIMARC-xsl-templates.patch (text/plain), 4.60 KB, created by
Ere Maijala
on 2018-10-24 09:42:16 UTC
(
hide
)
Description:
Bug 14716: URI-encode URLs in UNIMARC xsl templates.
Filename:
MIME Type:
Creator:
Ere Maijala
Created:
2018-10-24 09:42:16 UTC
Size:
4.60 KB
patch
obsolete
>From 5293566cc0c11c0eeba89636ba070d33ba312801 Mon Sep 17 00:00:00 2001 >From: Ere Maijala <ere.maijala@helsinki.fi> >Date: Thu, 22 Feb 2018 15:37:25 +0200 >Subject: [PATCH] Bug 14716: URI-encode URLs in UNIMARC xsl templates. > >https://bugs.koha-community.org/show_bug.cgi?id=14716 > >Test plan: > >1. Catalog a record with series name "Series & more" >2. Find the record >3. Make sure clicking the "Series & more" link works and the ampersand is properly encoded in the URL. >4. Also try the attached test records and make sure their links work. > >Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> >--- > koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl | 7 ++++--- > koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl | 11 ++++++----- > 2 files changed, 10 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl >index 65ec306..e78e8d7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl >@@ -6,7 +6,8 @@ > xmlns:marc="http://www.loc.gov/MARC21/slim" > xmlns:items="http://www.koha-community.org/items" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >- exclude-result-prefixes="marc items"> >+ xmlns:str="http://exslt.org/strings" >+ exclude-result-prefixes="marc items str"> > > <xsl:template name="datafield"> > <xsl:param name="tag"/> >@@ -252,7 +253,7 @@ > <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su:<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/></xsl:attribute> > </xsl:otherwise> > </xsl:choose> > <xsl:call-template name="chopPunctuation"> >@@ -289,7 +290,7 @@ > <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:<xsl:value-of select="marc:subfield[@code='a']"/><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='b']"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=au:<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='b']"/></xsl:attribute> > </xsl:otherwise> > </xsl:choose> > <xsl:if test="marc:subfield[@code='a']"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl >index 97206aa..00c0741 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl >@@ -6,7 +6,8 @@ > xmlns:marc="http://www.loc.gov/MARC21/slim" > xmlns:items="http://www.koha-community.org/items" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >- exclude-result-prefixes="marc items"> >+ xmlns:str="http://exslt.org/strings" >+ exclude-result-prefixes="marc items str"> > > <xsl:template name="datafield"> > <xsl:param name="tag"/> >@@ -291,7 +292,7 @@ > <a> > <xsl:attribute name="href"> > <xsl:text>/cgi-bin/koha/opac-search.pl?q=su:</xsl:text> >- <xsl:value-of select="marc:subfield[@code='a']"/> >+ <xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/> > </xsl:attribute> > <xsl:call-template name="chopPunctuation"> > <xsl:with-param name="chopString"> >@@ -355,9 +356,9 @@ > <xsl:otherwise> > <xsl:attribute name="href"> > <xsl:text>/cgi-bin/koha/opac-search.pl?q=au:</xsl:text> >- <xsl:value-of select="marc:subfield[@code='a']"/> >- <xsl:text> </xsl:text> >- <xsl:value-of select="marc:subfield[@code='b']"/> >+ <xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/> >+ <xsl:text>%20</xsl:text> >+ <xsl:value-of select="str:encode-uri(marc:subfield[@code='b'], true())"/> > </xsl:attribute> > </xsl:otherwise> > </xsl:choose> >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14716
:
41870
|
43385
|
43386
|
43412
|
43413
|
44174
|
44175
|
45743
|
72089
|
73598
|
73605
|
74226
|
74227
|
74228
|
74804
|
76425
|
77471
|
78809
|
80701
|
81052
|
81053
|
81054
|
81305
|
81520
|
81521
|
81522
|
81523