[Koha-patches] [PATCH] fix to remove leading/trailing whitespace from entered barcode.

Joe Atzberger joe.atzberger at liblime.com
Fri Mar 20 15:33:14 CET 2009


Why not use \s, the regexp class for whitespace instead of [ \t]?  Is there
a situation where we need to keep newlines or the nearly forgotten character
o' the Deep, the vertical-tab?
--joe

On Thu, Mar 19, 2009 at 6:52 PM, Mason James <mason.loves.sushi at gmail.com>wrote:

> ---
>  circ/circulation.pl |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/circ/circulation.pl b/circ/circulation.pl
> index 631df50..d89c637 100755
> --- a/circ/circulation.pl
> +++ b/circ/circulation.pl
> @@ -112,6 +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 = barcodedecode($barcode) if( $barcode &&
> C4::Context->preference('itemBarcodeInputFilter'));
>  my $stickyduedate  = $query->param('stickyduedate');
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-patches/attachments/20090320/102b62ed/attachment-0001.htm>


More information about the Koha-patches mailing list