getalert - do not generate bad SQL for borrowernumber=0
authorGalen Charlton <galen.charlton@liblime.com>
Sat, 16 Feb 2008 02:01:11 +0000 (15:01 +1300)
committerJoshua Ferraro <jmf@liblime.com>
Sat, 16 Feb 2008 17:29:16 +0000 (11:29 -0600)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Letters.pm

index 07520ed..857dc56 100644 (file)
@@ -175,7 +175,7 @@ sub getalert {
     my $dbh   = C4::Context->dbh;
     my $query = "select * from alert where";
     my @bind;
-    if ($borrowernumber) {
+    if ($borrowernumber =~ /^\d+$/) {
         $query .= " borrowernumber=? and";
         push @bind, $borrowernumber;
     }