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 <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit ec938d2a1d)
Signed-off-by: Jacob O'Mara <Jacob.omara@openfifth.co.uk>
This commit is contained in:
Tadeusz „tadzik” Sośnierz 2026-04-20 13:42:07 +02:00 committed by Jacob O'Mara
parent 64a36ad2fe
commit 35b20bfc1b
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

View File

@ -203,7 +203,7 @@
[% ELSE %]
<strong>[% ISSUE.title | html %]</strong>
[% END %]
[% IF ( newissues.match(ISSUE.barcode)) %]
[% IF ( newissues.match('\Q' + ISSUE.barcode + '\E')) %]
<span class="badge text-bg-info">NEW</span>
[% END %]
<span class="item-details">[% ISSUE.author | html %]</span>