From 35b20bfc1bb3ca4b4149c26945f74fdeaee2eef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadeusz=20=E2=80=9Etadzik=E2=80=9D=20So=C5=9Bnierz?= Date: Mon, 20 Apr 2026 13:42:07 +0200 Subject: [PATCH] Bug 27826: Escape regexes when checking for new items in sco-main.tt Test plan: 1. In KTD, go to cgi-bin/koha/catalogue/detail.pl?biblionumber=11 2. Edit the item, set its biblionumber to "+12345" 3. Go to self-checkout at /cgi-bin/koha/sco/sco-main.pl, log in (42:koha) 4. Enter "+12345" into the "Scan a new item" input field, submit 5. Observe a crash 6. Apply patch 7. Refresh the page, observe no patch 8. Renew item, refresh a few times, to observe the "NEW" badge working as expected Signed-off-by: David Nind Signed-off-by: Jonathan Druart Signed-off-by: Lucas Gass (cherry picked from commit ec938d2a1d5be1887dd3bce99382664fa89c5c48) Signed-off-by: Jacob O'Mara --- koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt index 663cb9072e..aa7cabaccf 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt @@ -203,7 +203,7 @@ [% ELSE %] [% ISSUE.title | html %] [% END %] - [% IF ( newissues.match(ISSUE.barcode)) %] + [% IF ( newissues.match('\Q' + ISSUE.barcode + '\E')) %] NEW [% END %] [% ISSUE.author | html %]