From 6948d04f74a29f2616e89858e81db80b43c69c10 Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Fri, 28 Nov 2025 11:24:18 +0000 Subject: [PATCH] Bug 41330: Escape braces in serials number management Do not apply patches before 1 - Create a new subscription to a serial 2 - Go to 'Serial Collection' panel and click on edit serials button 3 - Try and edit the serial number to "{1}" -> error 500 4 - Apply only unit tests patch and run `prove t/Serials/ModSerialStatus.t` -> Tests will not pass 5 - Apply patch and proceed again to 2&3 -> you will get no error 6 - run `prove t/Serials/ModSerialStatus.t` -> tests will pass Signed-off-by: David Nind --- C4/Serials.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index b8f6b39216..8982eabfe6 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -1207,7 +1207,7 @@ sub _handle_seqno { my ( $seq, $list, $op ) = @_; # op = ADD | REMOVE | CHECK (default: ADD) my $seq_r = $seq; - $seq_r =~ s/([()])/\\$1/g; # Adjust disturbing parentheses for regex, maybe extend in future + $seq_r =~ s/([(){}])/\\$1/g; # Adjust disturbing parentheses for regex, maybe extend in future if ( !$op or $op eq 'ADD' ) { $list .= "; $seq" if $list !~ /(^|;)\s*$seq_r(?=;|$)/; -- 2.39.5