From 32261b1e44faf61468ad1a74fcdb7fc4c4d213d6 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 (cherry picked from commit 217c8a656f8ba46aa12e5e21f3d0d86132950788) Signed-off-by: Martin Renvoize --- .../en/xslt/MARC21slim2intranetDetail.xsl | 57 ++++++++++++------- .../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, 89 insertions(+), 45 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index 714afd565c..acddfdb7c3 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 @@ -695,13 +697,14 @@ AND (su: ) + 1 - /cgi-bin/koha/catalogue/search.pl?q=su: + /cgi-bin/koha/catalogue/search.pl?q=su: @@ -753,6 +756,7 @@ AND (su: ) + 1 @@ -984,9 +988,13 @@ - - a_t - + + + + a_t + + + @@ -1000,7 +1008,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -1008,7 +1016,6 @@ - @@ -1064,7 +1071,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: @@ -1123,7 +1130,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -1185,7 +1192,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -1294,10 +1301,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:"" @@ -1522,6 +1529,7 @@ + @@ -1532,7 +1540,14 @@ - + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl index 6ea9af241d..c4e77f272f 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 192107b280..95895d38f0 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 196d709bc1..33966dfdc5 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: - + @@ -1662,6 +1664,7 @@ + @@ -1672,6 +1675,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