From 851d41ab6b9ec28901086d6a6ce15b3fd589182a Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 29 May 2019 13:46:15 +0000 Subject: [PATCH] Bug 23006: Cannot use inventory with barcodes containing special chars If a barcode contains special characters like $, the regex in inventory does no longer work. This fix (as suggested by Jonathan) replaces the regex by a eq compare. Test plan: Pick one barcode and add a $ somewhere in the middle, say 123$456. Include this barcode in a barcode file for inventory. Run inventory on that file and verify that barcode was read and datelastseen was updated. The barcode should not be reported as missing (not scanned). Signed-off-by: Marcel de Rooy Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- tools/inventory.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/inventory.pl b/tools/inventory.pl index 96a6bdf5ca..934f121f90 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -328,7 +328,7 @@ if ( $compareinv2barcd ) { my $barcode = $item->{barcode}; if( !$barcode ) { $item->{problems}->{no_barcode} = 1; - } elsif ( grep /^$barcode$/, @scanned_barcodes ) { + } elsif ( grep { $_ eq $barcode } @scanned_barcodes ) { next; } else { $item->{problems}->{not_scanned} = 1; -- 2.39.5