Copies the regexp from circulation.pl to strip leading and trailing spaces from 
barcodes to returns.pl.
---
 circ/returns.pl |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/circ/returns.pl b/circ/returns.pl
index adec8f6..9e79bbe 100755
--- a/circ/returns.pl
+++ b/circ/returns.pl
@@ -105,6 +105,7 @@ foreach ( $query->param ) {
     $counter++;
 
     # decode barcode    ## Didn't we already decode them before passing them 
back last time??
+    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
     $barcode = barcodedecode($barcode) 
if(C4::Context->preference('itemBarcodeInputFilter'));
 
     ######################
@@ -184,6 +185,7 @@ if ($dotransfer){
 
 # actually return book and prepare item table.....
 if ($barcode) {
+    $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
     $barcode = barcodedecode($barcode) if 
C4::Context->preference('itemBarcodeInputFilter');
     $itemnumber = GetItemnumberFromBarcode($barcode);
 
-- 
1.5.6.5

_______________________________________________
Koha-patches mailing list
[email protected]
http://lists.koha.org/mailman/listinfo/koha-patches

Reply via email to