Bugzilla – Attachment 81523 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: Fix more unencoded url parameters.
Bug-14716-Fix-more-unencoded-url-parameters.patch (text/plain), 52.88 KB, created by
Martin Renvoize (ashimema)
on 2018-10-29 15:31:10 UTC
(
hide
)
Description:
Bug 14716: Fix more unencoded url parameters.
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2018-10-29 15:31:10 UTC
Size:
52.88 KB
patch
obsolete
>From 9301801b2d2364b49b56933e3aa6db6280de5d4a Mon Sep 17 00:00:00 2001 >From: Ere Maijala <ere.maijala@helsinki.fi> >Date: Fri, 26 Oct 2018 18:13:10 +0300 >Subject: [PATCH] Bug 14716: Fix more unencoded url parameters. > >Fixes issues found during QA and unifies the SubfieldSelect function across the utils xsl's. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/en/xslt/MARC21slim2ATOM.xsl | 2 +- > .../en/xslt/MARC21slim2intranetDetail.xsl | 14 +++++------ > .../en/xslt/MARC21slim2intranetResults.xsl | 4 ++-- > .../prog/en/xslt/MARC21slimUtils.xsl | 11 +++++---- > .../en/xslt/NORMARCslim2intranetDetail.xsl | 13 +++++----- > .../en/xslt/NORMARCslim2intranetResults.xsl | 10 ++++---- > .../prog/en/xslt/NORMARCslimUtils.xsl | 19 +++++++++++---- > .../en/xslt/UNIMARCslim2intranetResults.xsl | 2 +- > .../prog/en/xslt/UNIMARCslimUtils.xsl | 14 ++++++++--- > .../en/xslt/MARC21slim2OPACDetail.xsl | 24 +++++++++---------- > .../en/xslt/MARC21slim2OPACResults.xsl | 2 +- > .../bootstrap/en/xslt/MARC21slimUtils.xsl | 19 +++++++++++---- > .../en/xslt/NORMARCslim2OPACDetail.xsl | 18 +++++++------- > .../en/xslt/NORMARCslim2OPACResults.xsl | 4 ++-- > .../bootstrap/en/xslt/NORMARCslimUtils.xsl | 19 +++++++++++---- > .../en/xslt/UNIMARCslim2OPACResults.xsl | 2 +- > .../bootstrap/en/xslt/UNIMARCslimUtils.xsl | 16 +++++++++---- > 17 files changed, 119 insertions(+), 74 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2ATOM.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2ATOM.xsl >index aabefe46fa..1233d67f8c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2ATOM.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2ATOM.xsl >@@ -23,7 +23,7 @@ > <xsl:for-each select="marc:controlfield[@tag=001]"> > <id> > <xsl:text>urn:tcn:</xsl:text> >- <xsl:value-of select="."/> >+ <xsl:value-of select="str:encode-uri(., true())"/> > </id> > </xsl:for-each> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index a5a9454fed..795ddfff23 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -261,7 +261,7 @@ > <a> > <xsl:choose> > <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:controlfield[@tag=001], true())"/>+and+(bib-level:a+or+bib-level:b)</xsl:attribute> > </xsl:when> > <xsl:otherwise> > <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Host-item:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute> >@@ -278,7 +278,7 @@ > <a> > <xsl:choose> > <xsl:when test="$UseControlNumber = '1' and marc:controlfield[@tag=001]"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="marc:controlfield[@tag=001]"/>+not+(bib-level:a+or+bib-level:b)</xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=rcn:<xsl:value-of select="str:encode-uri(marc:controlfield[@tag=001], true())"/>+not+(bib-level:a+or+bib-level:b)</xsl:attribute> > </xsl:when> > <xsl:otherwise> > <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate(marc:datafield[@tag=245]/marc:subfield[@code='a'], '/', ''), true())"/></xsl:attribute> >@@ -653,7 +653,7 @@ > <xsl:choose> > <!-- #1807 Strip unwanted parenthesis from subjects for searching --> > <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:when test="$TraceSubjectSubdivisions='1'"> > <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelectSubject"> >@@ -686,7 +686,7 @@ > <xsl:if test="marc:subfield[@code=9]"> > <xsl:text> </xsl:text> > <a class='authlink'> >- <xsl:attribute name="href">/cgi-bin/koha/authorities/detail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/authorities/detail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > <xsl:element name="img"> > <xsl:attribute name="src">/intranet-tmpl/prog/img/filefind.png</xsl:attribute> > <xsl:attribute name="alt"></xsl:attribute> >@@ -712,7 +712,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:when test="$TraceSubjectSubdivisions='1'"> > <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=<xsl:call-template name="subfieldSelect"> >@@ -967,7 +967,7 @@ > </a> > </xsl:when> > <xsl:when test="marc:subfield[@code='0']"> >- <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute> >+ <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:subfield[@code='0'], true())"/></xsl:attribute> > <xsl:value-of select="$f773"/> > </a> > </xsl:when> >@@ -1168,7 +1168,7 @@ > > <xsl:if test="$OPACBaseURL!=''"> > <span class="results_summary"><span class="label">OPAC view: </span> >- <a><xsl:attribute name="href"><xsl:value-of select="$OPACBaseURL"/>/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/></xsl:attribute><xsl:attribute name="target">_blank</xsl:attribute>Open in new window</a>. >+ <a><xsl:attribute name="href"><xsl:value-of select="$OPACBaseURL"/>/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:datafield[@tag=999]/marc:subfield[@code='c'], true())"/></xsl:attribute><xsl:attribute name="target">_blank</xsl:attribute>Open in new window</a>. > </span> > </xsl:if> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >index 266e06de10..1a64983a33 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >@@ -306,7 +306,7 @@ > <xsl:value-of select="$IntranetBiblioDefaultView"/> > </xsl:with-param> > </xsl:call-template> >- <xsl:value-of select="$biblionumber"/> >+ <xsl:value-of select="str:encode-uri($biblionumber, true())"/> > </xsl:attribute> > <xsl:attribute name="class">title</xsl:attribute> > >@@ -354,7 +354,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> > <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:attribute> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >index 68ebd8015d..bb5a254044 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >@@ -44,7 +44,7 @@ > </xsl:variable> > <xsl:choose> > <xsl:when test="$urlencode=1"> >- <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)) )"/> >+ <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)), true())"/> > </xsl:when> > <xsl:otherwise> > <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> >@@ -125,16 +125,17 @@ > Assumes LOC convention: (OrgCode)recordNumber. > If OrgCode is not present, return full string. > Additionally, handle various brackets/parentheses. Chop leading and trailing spaces. >+ Returns the value URI-encoded. > --> > <xsl:template name="extractControlNumber"> > <xsl:param name="subfieldW"/> > <xsl:variable name="tranW" select="translate($subfieldW,']})>','))))')"/> > <xsl:choose> > <xsl:when test="contains($tranW,')')"> >- <xsl:value-of select="normalize-space(translate(substring-after($tranW,')'),'[]{}()<>',''))"/> >+ <xsl:value-of select="str:encode-uri(normalize-space(translate(substring-after($tranW,')'),'[]{}()<>','')), true())"/> > </xsl:when> > <xsl:otherwise> >- <xsl:value-of select="normalize-space($subfieldW)"/> >+ <xsl:value-of select="str:encode-uri(normalize-space($subfieldW), true())"/> > </xsl:otherwise> > </xsl:choose> > </xsl:template> >@@ -197,13 +198,13 @@ > <xsl:choose> > <xsl:when test="boolean($bibno)"> > <a> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="$bibno"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="str:encode-uri($bibno, true())"/></xsl:attribute> > <xsl:value-of select="$str"/> > </a> > </xsl:when> > <xsl:when test="boolean($index) and boolean(marc:subfield[@code=9]) and $UseAuthoritiesForTracings='1'"> > <a> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > <xsl:value-of select="$str"/> > </a> > </xsl:when> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl >index 874f46ab98..861488963e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetDetail.xsl >@@ -106,7 +106,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9]"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> > <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:attribute> >@@ -121,7 +121,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9]"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> > <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:attribute> >@@ -135,7 +135,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9]"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> > <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:attribute> >@@ -248,7 +248,7 @@ > <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if> > </xsl:when> > <xsl:when test="marc:subfield[@code='0']"> >- <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute> >+ <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:subfield[@code='0'], true())"/></xsl:attribute> > <xsl:value-of select="$f773"/> > </a> > </xsl:when> >@@ -408,7 +408,7 @@ > <xsl:choose> > <!-- Will implement this later > <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > --> > <xsl:when test="$TraceSubjectSubdivisions='1'"> >@@ -417,6 +417,7 @@ > <xsl:with-param name="delimeter"> AND </xsl:with-param> > <xsl:with-param name="prefix">(su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="$TracingQuotesLeft"/></xsl:with-param> > <xsl:with-param name="suffix"><xsl:value-of select="$TracingQuotesRight"/>)</xsl:with-param> >+ <xsl:with-param name="urlencode">1</xsl:with-param> > </xsl:call-template> > </xsl:attribute> > </xsl:when> >@@ -602,7 +603,7 @@ > <!-- This will only work if the OPACBaseURL syspref is set. --> > <xsl:if test="string-length($OPACBaseURL) > 0"> > <p>OPAC View: <a> >- <xsl:attribute name="href"><xsl:value-of select="$OPACBaseURL"/>/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="$biblionumber"/></xsl:attribute> >+ <xsl:attribute name="href"><xsl:value-of select="$OPACBaseURL"/>/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="str:encode-uri($biblionumber, true())"/></xsl:attribute> > <xsl:attribute name="target">_blank</xsl:attribute> > Open in new window > </a></p> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetResults.xsl >index 9fff0a01ed..0c8711765b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetResults.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslim2intranetResults.xsl >@@ -260,7 +260,7 @@ > <xsl:value-of select="$IntranetBiblioDefaultView"/> > </xsl:with-param> > </xsl:call-template> >- <xsl:value-of select="$biblionumber"/> >+ <xsl:value-of select="str:encode-uri($biblionumber, true())"/> > </xsl:attribute> > <xsl:attribute name="class">title</xsl:attribute> > >@@ -306,7 +306,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> > <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:attribute> >@@ -321,7 +321,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> > <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:attribute> >@@ -343,7 +343,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> > <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:attribute> >@@ -448,7 +448,7 @@ > <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if> > </xsl:when> > <xsl:when test="marc:subfield[@code='0']"> >- <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute> >+ <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:subfield[@code='0'], true())"/></xsl:attribute> > <xsl:value-of select="$f773"/> > </a> > </xsl:when> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslimUtils.xsl >index 458253de57..e068fab616 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/NORMARCslimUtils.xsl >@@ -32,6 +32,7 @@ > <xsl:param name="subdivDelimiter"/> > <xsl:param name="prefix"/> > <xsl:param name="suffix"/> >+ <xsl:param name="urlencode"/> > <xsl:variable name="str"> > <xsl:for-each select="marc:subfield"> > <xsl:if test="contains($codes, @code)"> >@@ -42,7 +43,14 @@ > </xsl:if> > </xsl:for-each> > </xsl:variable> >- <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> >+ <xsl:choose> >+ <xsl:when test="$urlencode=1"> >+ <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)), true())"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> >+ </xsl:otherwise> >+ </xsl:choose> > </xsl:template> > > <xsl:template name="buildSpaces"> >@@ -99,16 +107,17 @@ > Assumes LOC convention: (OrgCode)recordNumber. > If OrgCode is not present, return full string. > Additionally, handle various brackets/parentheses. Chop leading and trailing spaces. >+ Returns the value URI-encoded. > --> > <xsl:template name="extractControlNumber"> > <xsl:param name="subfieldW"/> > <xsl:variable name="tranW" select="translate($subfieldW,']})>','))))')"/> > <xsl:choose> > <xsl:when test="contains($tranW,')')"> >- <xsl:value-of select="normalize-space(translate(substring-after($tranW,')'),'[]{}()<>',''))"/> >+ <xsl:value-of select="str:encode-uri(normalize-space(translate(substring-after($tranW,')'),'[]{}()<>','')), true())"/> > </xsl:when> > <xsl:otherwise> >- <xsl:value-of select="normalize-space($subfieldW)"/> >+ <xsl:value-of select="str:encode-uri(normalize-space($subfieldW), true())"/> > </xsl:otherwise> > </xsl:choose> > </xsl:template> >@@ -218,13 +227,13 @@ > <xsl:choose> > <xsl:when test="boolean($bibno)"> > <a> >- <xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="$bibno"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="str:encode-uri($bibno, true())"/></xsl:attribute> > <xsl:value-of select="$str"/> > </a> > </xsl:when> > <xsl:when test="boolean($index) and boolean(marc:subfield[@code=9])"> > <a> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > <xsl:value-of select="$str"/> > </a> > </xsl:when> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetResults.xsl >index 3e30890cd5..a6ba1c22c6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetResults.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetResults.xsl >@@ -34,7 +34,7 @@ > <xsl:value-of select="$IntranetBiblioDefaultView"/> > </xsl:with-param> > </xsl:call-template> >- <xsl:value-of select="$biblionumber"/> >+ <xsl:value-of select="str:encode-uri($biblionumber, true())"/> > </xsl:attribute> > <xsl:attribute name="class">title</xsl:attribute> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl >index e78e8d7c55..48d50c5b50 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl >@@ -115,6 +115,7 @@ > <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param> > <xsl:param name="subdivCodes"/> > <xsl:param name="subdivDelimiter"/> >+ <xsl:param name="urlencode"/> > <xsl:variable name="str"> > <xsl:for-each select="marc:subfield"> > <xsl:if test="contains($codes, @code)"> >@@ -125,7 +126,14 @@ > </xsl:if> > </xsl:for-each> > </xsl:variable> >- <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> >+ <xsl:choose> >+ <xsl:when test="$urlencode=1"> >+ <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)), true())"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> >+ </xsl:otherwise> >+ </xsl:choose> > </xsl:template> > > <xsl:template name="buildSpaces"> >@@ -250,7 +258,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9]"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> > <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> >@@ -287,7 +295,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9]"> >- <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> > <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> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >index d878c65823..9fe561d8cf 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl >@@ -725,7 +725,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <!-- #1807 Strip unwanted parenthesis from subjects for searching --> > <xsl:when test="$TraceSubjectSubdivisions='1'"> >@@ -756,7 +756,7 @@ > </span> > <xsl:if test="marc:subfield[@code=9]"> > <a class='authlink'> >- <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > <xsl:element name="img"> > <xsl:attribute name="src">/opac-tmpl/<xsl:value-of select="$theme"/>/images/filefind.png</xsl:attribute> > <xsl:attribute name="style">vertical-align:middle</xsl:attribute> >@@ -781,7 +781,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:when test="$TraceSubjectSubdivisions='1'"> > <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:call-template name="subfieldSelectSubject"> >@@ -839,7 +839,7 @@ > <xsl:text>/cgi-bin/koha/opac-search.pl?q=control-number:</xsl:text> > <xsl:call-template name="extractControlNumber"> > <xsl:with-param name="subfieldW"> >- <xsl:value-of select="str:encode-uri(marc:subfield[@code='w'], true())"/> >+ <xsl:value-of select="marc:subfield[@code='w']"/> > </xsl:with-param> > </xsl:call-template> > </xsl:attribute> >@@ -1070,12 +1070,12 @@ > </a> > </xsl:when> > <xsl:when test="marc:subfield[@code='0']"> >- <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute> >+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:subfield[@code='0'], true())"/></xsl:attribute> > <xsl:value-of select="$f773"/> > </a> > </xsl:when> > <xsl:otherwise> >- <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute> >+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f773, '()', ''), true())"/></xsl:attribute> > <xsl:value-of select="$f773"/> > </a> > </xsl:otherwise> >@@ -1166,7 +1166,7 @@ > <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute> > </xsl:when> > <xsl:otherwise> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f775, '()', '')"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f775, '()', ''), true())"/></xsl:attribute> > </xsl:otherwise> > </xsl:choose> > <xsl:call-template name="subfieldSelect"> >@@ -1225,7 +1225,7 @@ > </a> > </xsl:when> > <xsl:otherwise> >- <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f780, '()', '')"/></xsl:attribute> >+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f780, '()', ''), true())"/></xsl:attribute> > <xsl:value-of select="translate($f780, '()', '')"/> > </a> > </xsl:otherwise> >@@ -1288,7 +1288,7 @@ > </a> > </xsl:when> > <xsl:otherwise> >- <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="translate($f785, '()', '')"/></xsl:attribute> >+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=ti,phr:<xsl:value-of select="str:encode-uri(translate($f785, '()', ''), true())"/></xsl:attribute> > <xsl:value-of select="translate($f785, '()', '')"/> > </a> > </xsl:otherwise> >@@ -1335,10 +1335,10 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:"<xsl:value-of select="marc:subfield[@code=9]"/>"</xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:"<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/>"</xsl:attribute> > </xsl:when> > <xsl:otherwise> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:"<xsl:value-of select="marc:subfield[@code='a']"/>"</xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:"<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/>"</xsl:attribute> > </xsl:otherwise> > </xsl:choose> > <span resource="#record"><span> >@@ -1568,7 +1568,7 @@ > </a> > <xsl:if test="marc:subfield[@code=9]"> > <a class='authlink'> >- <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > <xsl:element name="img"> > <xsl:attribute name="src">/opac-tmpl/<xsl:value-of select="$theme"/>/images/filefind.png</xsl:attribute> > <xsl:attribute name="style">vertical-align:middle</xsl:attribute> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >index e98d3de47b..b7395c9da8 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl >@@ -413,7 +413,7 @@ > <xsl:value-of select="$BiblioDefaultView"/> > </xsl:with-param> > </xsl:call-template> >- <xsl:value-of select="$biblionumber"/> >+ <xsl:value-of select="str:encode-uri($biblionumber, true())"/> > </xsl:attribute> > <xsl:attribute name="class">title</xsl:attribute> > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >index e4ab72ad30..97df929be5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl >@@ -31,6 +31,7 @@ > <xsl:param name="subdivDelimiter"/> > <xsl:param name="prefix"/> > <xsl:param name="suffix"/> >+ <xsl:param name="urlencode"/> > <xsl:variable name="str"> > <xsl:for-each select="marc:subfield"> > <xsl:if test="contains($codes, @code)"> >@@ -41,7 +42,14 @@ > </xsl:if> > </xsl:for-each> > </xsl:variable> >- <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> >+ <xsl:choose> >+ <xsl:when test="$urlencode=1"> >+ <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)), true())"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> >+ </xsl:otherwise> >+ </xsl:choose> > </xsl:template> > > <xsl:template name="subfieldSelectSpan"> >@@ -114,16 +122,17 @@ > Assumes LOC convention: (OrgCode)recordNumber. > If OrgCode is not present, return full string. > Additionally, handle various brackets/parentheses. Chop leading and trailing spaces. >+ Returns the value URI-encoded. > --> > <xsl:template name="extractControlNumber"> > <xsl:param name="subfieldW"/> > <xsl:variable name="tranW" select="translate($subfieldW,']})>','))))')"/> > <xsl:choose> > <xsl:when test="contains($tranW,')')"> >- <xsl:value-of select="normalize-space(translate(substring-after($tranW,')'),'[]{}()<>',''))"/> >+ <xsl:value-of select="str:encode-uri(normalize-space(translate(substring-after($tranW,')'),'[]{}()<>','')), true())"/> > </xsl:when> > <xsl:otherwise> >- <xsl:value-of select="normalize-space($subfieldW)"/> >+ <xsl:value-of select="str:encode-uri(normalize-space($subfieldW), true())"/> > </xsl:otherwise> > </xsl:choose> > </xsl:template> >@@ -186,13 +195,13 @@ > <xsl:choose> > <xsl:when test="boolean($bibno)"> > <a> >- <xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="$bibno"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="str:encode-uri($bibno, true())"/></xsl:attribute> > <xsl:value-of select="$str"/> > </a> > </xsl:when> > <xsl:when test="boolean($index) and boolean(marc:subfield[@code=9])"> > <a> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > <xsl:value-of select="$str"/> > </a> > </xsl:when> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACDetail.xsl >index 917de68fb3..36486ba7d7 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACDetail.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACDetail.xsl >@@ -101,7 +101,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9]"> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> > <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/></xsl:attribute> >@@ -110,7 +110,7 @@ > <xsl:call-template name="nameABCDQ"/></a> > <xsl:if test="marc:subfield[@code=9]"> > <a class='authlink'> >- <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > <xsl:element name="img"> > <xsl:attribute name="src">/opac-tmpl/<xsl:value-of select="$theme"/>/images/filefind.png</xsl:attribute> > <xsl:attribute name="style">vertical-align:middle</xsl:attribute> >@@ -127,7 +127,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9]"> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> > <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/></xsl:attribute> >@@ -136,7 +136,7 @@ > <xsl:call-template name="nameABCDN"/></a> > <xsl:if test="marc:subfield[@code=9]"> > <a class='authlink'> >- <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > <xsl:element name="img"> > <xsl:attribute name="src">/opac-tmpl/<xsl:value-of select="$theme"/>/images/filefind.png</xsl:attribute> > <xsl:attribute name="style">vertical-align:middle</xsl:attribute> >@@ -152,7 +152,7 @@ > <a> > <xsl:choose> > <xsl:when test="marc:subfield[@code=9]"> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > <xsl:otherwise> > <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=au:<xsl:value-of select="str:encode-uri(marc:subfield[@code='a'], true())"/></xsl:attribute> >@@ -161,7 +161,7 @@ > <xsl:call-template name="nameACDEQ"/></a> > <xsl:if test="marc:subfield[@code=9]"> > <a class='authlink'> >- <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > <xsl:element name="img"> > <xsl:attribute name="src">/opac-tmpl/<xsl:value-of select="$theme"/>/images/filefind.png</xsl:attribute> > <xsl:attribute name="style">vertical-align:middle</xsl:attribute> >@@ -277,7 +277,7 @@ > <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if> > </xsl:when> > <xsl:when test="marc:subfield[@code='0']"> >- <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute> >+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:subfield[@code='0'], true())"/></xsl:attribute> > <xsl:value-of select="$f773"/> > </a> > </xsl:when> >@@ -437,7 +437,7 @@ > <xsl:choose> > <!-- Will implement this later > <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'"> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > </xsl:when> > --> > <xsl:when test="$TraceSubjectSubdivisions='1'"> >@@ -465,7 +465,7 @@ > </a> > <xsl:if test="marc:subfield[@code=9]"> > <a class='authlink'> >- <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > <xsl:element name="img"> > <xsl:attribute name="src">/opac-tmpl/<xsl:value-of select="$theme"/>/images/filefind.png</xsl:attribute> > <xsl:attribute name="style">vertical-align:middle</xsl:attribute> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACResults.xsl >index b1391463d0..534f51b1c2 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslim2OPACResults.xsl >@@ -299,7 +299,7 @@ > <xsl:value-of select="$BiblioDefaultView"/> > </xsl:with-param> > </xsl:call-template> >- <xsl:value-of select="$biblionumber"/> >+ <xsl:value-of select="str:encode-uri($biblionumber, true())"/> > </xsl:attribute> > <xsl:attribute name="class">title</xsl:attribute> > >@@ -436,7 +436,7 @@ > <xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if> > </xsl:when> > <xsl:when test="marc:subfield[@code='0']"> >- <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="marc:subfield[@code='0']"/></xsl:attribute> >+ <a><xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="str:encode-uri(marc:subfield[@code='0'], true())"/></xsl:attribute> > <xsl:value-of select="$f773"/> > </a> > </xsl:when> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslimUtils.xsl >index 403087a8d8..f06ee8130e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/NORMARCslimUtils.xsl >@@ -31,6 +31,7 @@ > <xsl:param name="subdivDelimiter"/> > <xsl:param name="prefix"/> > <xsl:param name="suffix"/> >+ <xsl:param name="urlencode"/> > <xsl:variable name="str"> > <xsl:for-each select="marc:subfield"> > <xsl:if test="contains($codes, @code)"> >@@ -41,7 +42,14 @@ > </xsl:if> > </xsl:for-each> > </xsl:variable> >- <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> >+ <xsl:choose> >+ <xsl:when test="$urlencode=1"> >+ <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)), true())"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> >+ </xsl:otherwise> >+ </xsl:choose> > </xsl:template> > > <xsl:template name="buildSpaces"> >@@ -95,16 +103,17 @@ > Assumes LOC convention: (OrgCode)recordNumber. > If OrgCode is not present, return full string. > Additionally, handle various brackets/parentheses. Chop leading and trailing spaces. >+ Returns the value URI-encoded. > --> > <xsl:template name="extractControlNumber"> > <xsl:param name="subfieldW"/> > <xsl:variable name="tranW" select="translate($subfieldW,']})>','))))')"/> > <xsl:choose> > <xsl:when test="contains($tranW,')')"> >- <xsl:value-of select="normalize-space(translate(substring-after($tranW,')'),'[]{}()<>',''))"/> >+ <xsl:value-of select="str:encode-uri(normalize-space(translate(substring-after($tranW,')'),'[]{}()<>','')), true())"/> > </xsl:when> > <xsl:otherwise> >- <xsl:value-of select="normalize-space($subfieldW)"/> >+ <xsl:value-of select="str:encode-uri(normalize-space($subfieldW), true())"/> > </xsl:otherwise> > </xsl:choose> > </xsl:template> >@@ -215,13 +224,13 @@ > <xsl:choose> > <xsl:when test="boolean($bibno)"> > <a> >- <xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="$bibno"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of select="str:encode-uri($bibno, true())"/></xsl:attribute> > <xsl:value-of select="$str"/> > </a> > </xsl:when> > <xsl:when test="boolean($index) and boolean(marc:subfield[@code=9])"> > <a> >- <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute> >+ <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/></xsl:attribute> > <xsl:value-of select="$str"/> > </a> > </xsl:when> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl >index 3c971773f0..874cf99f2b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACResults.xsl >@@ -48,7 +48,7 @@ > <xsl:value-of select="$BiblioDefaultView"/> > </xsl:with-param> > </xsl:call-template> >- <xsl:value-of select="$biblionumber"/> >+ <xsl:value-of select="str:encode-uri($biblionumber, true())"/> > </xsl:attribute> > <xsl:attribute name="class">title</xsl:attribute> > <xsl:value-of select="$ntitle" /> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl >index 00c07413a5..4195ddf7a7 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslimUtils.xsl >@@ -33,6 +33,7 @@ > <xsl:param name="delimeter"><xsl:text> </xsl:text></xsl:param> > <xsl:param name="subdivCodes"/> > <xsl:param name="subdivDelimiter"/> >+ <xsl:param name="urlencode"/> > <xsl:variable name="str"> > <xsl:for-each select="marc:subfield"> > <xsl:if test="contains($codes, @code)"> >@@ -43,7 +44,14 @@ > </xsl:if> > </xsl:for-each> > </xsl:variable> >- <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> >+ <xsl:choose> >+ <xsl:when test="$urlencode=1"> >+ <xsl:value-of select="str:encode-uri(substring($str,1,string-length($str)-string-length($delimeter)), true())"/> >+ </xsl:when> >+ <xsl:otherwise> >+ <xsl:value-of select="substring($str,1,string-length($str)-string-length($delimeter))"/> >+ </xsl:otherwise> >+ </xsl:choose> > </xsl:template> > > <xsl:template name="buildSpaces"> >@@ -265,7 +273,7 @@ > <a> > <xsl:attribute name="href"> > <xsl:text>/cgi-bin/koha/opac-search.pl?q=an:</xsl:text> >- <xsl:value-of select="."/> >+ <xsl:value-of select="str:encode-uri(., true())"/> > </xsl:attribute> > <xsl:choose> > <xsl:when test="string-length($display) > 0"> >@@ -350,7 +358,7 @@ > <xsl:when test="marc:subfield[@code=9]"> > <xsl:attribute name="href"> > <xsl:text>/cgi-bin/koha/opac-search.pl?q=an:</xsl:text> >- <xsl:value-of select="marc:subfield[@code=9]"/> >+ <xsl:value-of select="str:encode-uri(marc:subfield[@code=9], true())"/> > </xsl:attribute> > </xsl:when> > <xsl:otherwise> >@@ -381,7 +389,7 @@ > <a> > <xsl:attribute name="href"> > <xsl:text>/cgi-bin/koha/opac-idref.pl?unimarc3=</xsl:text> >- <xsl:value-of select="marc:subfield[@code=3]"/> >+ <xsl:value-of select="str:encode-uri(marc:subfield[@code=3], true())"/> > </xsl:attribute> > <xsl:attribute name="title">IdRef</xsl:attribute> > <xsl:attribute name="rel">gb_page_center[600,500]</xsl:attribute> >-- >2.19.1
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