From a4ec38d5fa654f69ff62bdb3fd1cf39d1dbbebfc Mon Sep 17 00:00:00 2001 From: Paul Derscheid Date: Fri, 17 Apr 2026 12:02:16 +0200 Subject: [PATCH] Bug 42283: (follow-up) URI-encode z3950 search params in GetZ3950Terms The original template rendered each Z39.50 search param with the "| uri" TT filter, so the generated query string was safe for values containing spaces, ampersands or other reserved characters. The JS port concatenates the raw values, producing a broken query string when any search field (title, author, subject, etc.) is not already URL-safe. Wrap name and value in encodeURIComponent to restore the original behaviour. To test: - Import or create a biblio whose title or author includes a space and an ampersand (e.g. "Q & A: Practical tests"). - From the cataloging search results, trigger the Z39.50 search for that record. - Confirm the request URL includes correctly encoded parameters (space as %20, & as %26) and that the Z39.50 results load. Signed-off-by: Paul Derscheid Signed-off-by: Jan Kissig Signed-off-by: Pedro Amorim --- koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt index 67bc91a8ca..e562f67305 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt @@ -417,7 +417,7 @@ function GetZ3950Terms(fw) { var strQuery = "&frameworkcode=" + fw; z3950_search_params.forEach(function (z3950_search_param) { - strQuery += "&" + z3950_search_param.name + "=" + z3950_search_param.value; + strQuery += "&" + encodeURIComponent(z3950_search_param.name) + "=" + encodeURIComponent(z3950_search_param.value); }); return strQuery; }