From 5fa71ca377e36040dd7c84f2d5883cdf90b2af7f 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 --- .../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 885a8dc48c..265a46dbce 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 @@ -658,13 +660,14 @@ AND (su: ) + 1 - /cgi-bin/koha/catalogue/search.pl?q=su: + /cgi-bin/koha/catalogue/search.pl?q=su: @@ -716,6 +719,7 @@ AND (su: ) + 1 @@ -964,7 +968,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -1025,7 +1029,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: @@ -1084,7 +1088,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -1146,7 +1150,7 @@ - /cgi-bin/koha/catalogue/search.pl?q=ti,phr: + /cgi-bin/koha/catalogue/search.pl?q=ti,phr: @@ -1255,10 +1259,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:"" @@ -1483,6 +1487,7 @@ + @@ -1493,7 +1498,14 @@ - + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl index 4edc2f2d2c..fa88edd825 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 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 f31b1beba5..4c48d3d6a5 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 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.17.1