From 7ab0c4d0fcf682107f48dd9212450cd0edc8b5fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kula?= <148193449+mkibp@users.noreply.github.com> Date: Tue, 6 Aug 2024 12:45:09 +0000 Subject: [PATCH] Bug 37573: Fix bad escaping in OPACSearchForTitleIn that broke JavaScript in 2. Go to OPAC and open some biblio record's page. 3. Open dev tools console (Ctrl+Shift+I). Before applying the patch you should see a syntax error, after applying it you should see "test!" logged. Signed-off-by: Magnus Enger Works as advertised. I added the test plan from Bugzilla to the commit message above. --- C4/Output.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Output.pm b/C4/Output.pm index d8ea0bfb52..84a3789ef7 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -408,7 +408,7 @@ sub parametrized_url { my $val_url = URI::Escape::uri_escape_utf8( $val // q{} ); $ret =~ s/\{$key\}/$val_url/g; } - $ret =~ s/\{[^\{]*\}//g; # remove remaining vars + $ret =~ s/\{[A-Z0-9_]+\}//g; # remove remaining vars return $ret; } -- 2.34.1