From 217c8a656f8ba46aa12e5e21f3d0d86132950788 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. Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- .../en/xslt/MARC21slim2intranetDetail.xsl | 46 ++++++++++++------- .../en/xslt/MARC21slim2intranetResults.xsl | 5 +- .../prog/en/xslt/MARC21slimUtils.xsl | 21 +++++++-- .../en/xslt/MARC21slim2OPACDetail.xsl | 40 ++++++++++------ .../bootstrap/en/xslt/MARC21slimUtils.xsl | 11 +++-- 5 files changed, 82 insertions(+), 41 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index 8e0ec68a5f..a5a9454fed 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"> @@ -190,7 +191,7 @@ Series: - /cgi-bin/koha/catalogue/search.pl?q=se,phr:"" + /cgi-bin/koha/catalogue/search.pl?q=se,phr:"" @@ -205,7 +206,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=se,phr:"" + /cgi-bin/koha/catalogue/search.pl?q=se,phr:"" @@ -222,7 +223,7 @@ - + /cgi-bin/koha/catalogue/search.pl?q=rcn: @@ -233,7 +234,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=se,phr:""&q=au:"" + /cgi-bin/koha/catalogue/search.pl?q=se,phr:""&q=au:"" @@ -263,7 +264,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 @@ -280,7 +281,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 @@ -298,7 +299,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: @@ -338,7 +339,8 @@ - + + /cgi-bin/koha/catalogue/search.pl?q=Provider:"" b @@ -659,13 +661,14 @@ AND (su: ) + 1 - /cgi-bin/koha/catalogue/search.pl?q=su: + /cgi-bin/koha/catalogue/search.pl?q=su: @@ -717,6 +720,7 @@ AND (su: ) + 1 @@ -968,7 +972,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -1031,7 +1035,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: @@ -1090,7 +1094,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -1152,7 +1156,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -1261,10 +1265,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:"" @@ -1489,6 +1493,7 @@ + @@ -1499,7 +1504,14 @@ - + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl index 7ab4e49d0e..266e06de10 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"> @@ -356,7 +357,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 a3db596e87..68ebd8015d 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 c6f15188ee..d878c65823 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"> @@ -207,7 +207,7 @@ Series: - /cgi-bin/koha/opac-search.pl?q=se,phr:"" + /cgi-bin/koha/opac-search.pl?q=se,phr:"" @@ -222,7 +222,7 @@ - /cgi-bin/koha/opac-search.pl?q=se,phr:"" + /cgi-bin/koha/opac-search.pl?q=se,phr:"" @@ -239,7 +239,7 @@ - + /cgi-bin/koha/opac-search.pl?q=rcn: @@ -250,7 +250,7 @@ - /cgi-bin/koha/opac-search.pl?q=se,phr:""&q=au:"" + /cgi-bin/koha/opac-search.pl?q=se,phr:""&q=au:"" @@ -276,10 +276,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 @@ -293,10 +293,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 @@ -314,7 +314,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: @@ -357,7 +357,7 @@ - + /cgi-bin/koha/opac-search.pl?q=Provider: b @@ -734,12 +734,13 @@ AND (su: ) + 1 - /cgi-bin/koha/opac-search.pl?q=su: + /cgi-bin/koha/opac-search.pl?q=su: @@ -788,11 +789,12 @@ AND (su: ) + 1 - /cgi-bin/koha/opac-search.pl?q=su: + /cgi-bin/koha/opac-search.pl?q=su: @@ -837,7 +839,7 @@ /cgi-bin/koha/opac-search.pl?q=control-number: - + @@ -1666,6 +1668,7 @@ + @@ -1676,6 +1679,13 @@ - + + + + + + + + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl index 596bddfd79..e4ab72ad30 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slimUtils.xsl @@ -1,6 +1,10 @@ ]> - + @@ -194,7 +198,7 @@ - /cgi-bin/koha/opac-search.pl?q=: + /cgi-bin/koha/opac-search.pl?q=: @@ -269,7 +273,8 @@ - + + /cgi-bin/koha/opac-search.pl?q=Provider:" b -- 2.39.5