From 6cd1eb17e4d33ccea2b568057bd9cf0ec4f40592 Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Thu, 22 Feb 2018 15:37:25 +0200 Subject: [PATCH] Bug 14716: URI-encode URLs in MARC21 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. --- .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 46 ++++++++++++++-------- .../prog/en/xslt/MARC21slim2intranetResults.xsl | 5 ++- .../intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl | 21 ++++++++-- .../bootstrap/en/xslt/MARC21slim2OPACDetail.xsl | 40 ++++++++++++------- .../bootstrap/en/xslt/MARC21slimUtils.xsl | 5 ++- 5 files changed, 77 insertions(+), 40 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index cf39ec4..ef28714 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -8,7 +8,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"> @@ -189,7 +190,7 @@ Series: - /cgi-bin/koha/catalogue/search.pl?q=se,phr:"" + /cgi-bin/koha/catalogue/search.pl?q=se,phr:"" @@ -204,7 +205,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=se,phr:"" + /cgi-bin/koha/catalogue/search.pl?q=se,phr:"" @@ -221,7 +222,7 @@ - + /cgi-bin/koha/catalogue/search.pl?q=rcn: @@ -232,7 +233,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=se,phr:"" + /cgi-bin/koha/catalogue/search.pl?q=se,phr:"" @@ -262,7 +263,7 @@ /cgi-bin/koha/catalogue/search.pl?q=rcn:+and+(bib-level:a+or+bib-level:b) - /cgi-bin/koha/catalogue/search.pl?q=Host-item: + /cgi-bin/koha/catalogue/search.pl?q=Host-item: Show analytics @@ -279,7 +280,7 @@ /cgi-bin/koha/catalogue/search.pl?q=rcn:+not+(bib-level:a+or+bib-level:b) - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: Show volumes @@ -297,7 +298,7 @@ /cgi-bin/koha/catalogue/search.pl?q=Control-number: - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -337,7 +338,8 @@ - + + /cgi-bin/koha/catalogue/search.pl?q=Provider:"" b @@ -694,13 +696,14 @@ AND (su: ) + 1 - /cgi-bin/koha/catalogue/search.pl?q=su: + /cgi-bin/koha/catalogue/search.pl?q=su: @@ -752,6 +755,7 @@ AND (su: ) + 1 @@ -1000,7 +1004,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -1061,7 +1065,7 @@ /cgi-bin/koha/catalogue/search.pl?q=Control-number: - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -1120,7 +1124,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -1182,7 +1186,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -1291,10 +1295,10 @@ - /cgi-bin/koha/catalogue/search.pl?q=an: + /cgi-bin/koha/catalogue/search.pl?q=an: - /cgi-bin/koha/catalogue/search.pl?q=au:"" + /cgi-bin/koha/catalogue/search.pl?q=au:"" @@ -1519,6 +1523,7 @@ + @@ -1529,7 +1534,14 @@ - + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl index 3e508c0..2d9123f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl @@ -5,7 +5,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"> @@ -355,7 +356,7 @@ /cgi-bin/koha/catalogue/search.pl?q=an: - /cgi-bin/koha/catalogue/search.pl?q=au:"" + /cgi-bin/koha/catalogue/search.pl?q=au:"" diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl index 192107b..95895d3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl @@ -1,6 +1,10 @@ ]> - + @@ -27,6 +31,7 @@ + @@ -37,7 +42,14 @@ - + + + + + + + + @@ -197,7 +209,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=: + /cgi-bin/koha/catalogue/search.pl?q=: @@ -271,7 +283,8 @@ - + + /cgi-bin/koha/catalogue/search.pl?q=Provider: b diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl index f31b1be..4c48d3d 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl @@ -7,7 +7,7 @@ xmlns:items="http://www.koha-community.org/items" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings" - exclude-result-prefixes="marc items"> + exclude-result-prefixes="marc items str"> @@ -206,7 +206,7 @@ Series: - /cgi-bin/koha/opac-search.pl?q=se,phr:"" + /cgi-bin/koha/opac-search.pl?q=se,phr:"" @@ -221,7 +221,7 @@ - /cgi-bin/koha/opac-search.pl?q=se,phr:"" + /cgi-bin/koha/opac-search.pl?q=se,phr:"" @@ -238,7 +238,7 @@ - + /cgi-bin/koha/opac-search.pl?q=rcn: @@ -249,7 +249,7 @@ - /cgi-bin/koha/opac-search.pl?q=se,phr:"" + /cgi-bin/koha/opac-search.pl?q=se,phr:"" @@ -275,10 +275,10 @@ - /cgi-bin/koha/opac-search.pl?q=rcn:+and+(bib-level:a+or+bib-level:b) + /cgi-bin/koha/opac-search.pl?q=rcn:+and+(bib-level:a+or+bib-level:b) - /cgi-bin/koha/opac-search.pl?q=Host-item: + /cgi-bin/koha/opac-search.pl?q=Host-item: Show analytics @@ -292,10 +292,10 @@ - /cgi-bin/koha/opac-search.pl?q=rcn:+not+(bib-level:a+or+bib-level:b) + /cgi-bin/koha/opac-search.pl?q=rcn:+not+(bib-level:a+or+bib-level:b) - /cgi-bin/koha/opac-search.pl?q=ti,phr: + /cgi-bin/koha/opac-search.pl?q=ti,phr: Show volumes @@ -313,7 +313,7 @@ /cgi-bin/koha/opac-search.pl?q=Control-number: - /cgi-bin/koha/opac-search.pl?q=ti,phr: + /cgi-bin/koha/opac-search.pl?q=ti,phr: @@ -356,7 +356,7 @@ - + /cgi-bin/koha/opac-search.pl?q=Provider: b @@ -733,12 +733,13 @@ AND (su: ) + 1 - /cgi-bin/koha/opac-search.pl?q=su: + /cgi-bin/koha/opac-search.pl?q=su: @@ -787,11 +788,12 @@ AND (su: ) + 1 - /cgi-bin/koha/opac-search.pl?q=su: + /cgi-bin/koha/opac-search.pl?q=su: @@ -836,7 +838,7 @@ /cgi-bin/koha/opac-search.pl?q=control-number: - + @@ -1660,6 +1662,7 @@ + @@ -1670,6 +1673,13 @@ - + + + + + + + + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl index 596bddf..e1636fa 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl @@ -194,7 +194,7 @@ - /cgi-bin/koha/opac-search.pl?q=: + /cgi-bin/koha/opac-search.pl?q=: @@ -269,7 +269,8 @@ - + + /cgi-bin/koha/opac-search.pl?q=Provider:" b -- 2.7.4