[Koha-patches] [PATCH] tweak removal of whitespace from barcodes

Galen Charlton galen.charlton at liblime.com
Mon May 11 18:40:20 CEST 2009


Per suggestion from Joe Atzberger, match on \s
instead of [ \t] for stripping leading and
trailing whitespace from barcode lookups.
---
 circ/circulation.pl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/circ/circulation.pl b/circ/circulation.pl
index 1c6fb61..982cc72 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -112,7 +112,7 @@ if (C4::Context->preference("AutoLocation") ne 1) { # FIXME: string comparison t
 }
 
 my $barcode        = $query->param('barcode') || '';
-$barcode =~  s/^[ \t]+|[ \t]+$//g; # remove leading/trailing whitespace
+$barcode =~  s/^\s*|\s*$//g; # remove leading/trailing whitespace
 
 $barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter'));
 my $stickyduedate  = $query->param('stickyduedate');
-- 
1.5.6.5




More information about the Koha-patches mailing list