Bug 13763: (follow-up) Strip leading whitespace characters from input barcode
authorJosef Moravec <josef.moravec@gmail.com>
Wed, 20 Mar 2019 15:52:07 +0000 (15:52 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 25 Mar 2019 14:37:40 +0000 (14:37 +0000)
this makes the work with barcodes from input consistant on checking out,
     checking in and renewing

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 28ff4f6393e65ebfca60c05611fafc926f1fb239)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

circ/renew.pl

index ef1a6ff..1f3254a 100755 (executable)
@@ -44,6 +44,7 @@ my ( $template, $librarian, $cookie, $flags ) = get_template_and_user(
 my $schema = Koha::Database->new()->schema();
 
 my $barcode        = $cgi->param('barcode');
+$barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespae
 $barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter'));
 my $override_limit = $cgi->param('override_limit');
 my $override_holds = $cgi->param('override_holds');