[Koha-patches] [PATCH] [SIGNED-OFF] Bug 6236 : When checking for expiry don't try to process 0 dates

Nicole C. Engard nengard at bywatersolutions.com
Wed Apr 20 18:45:38 CEST 2011


From: Colin Campbell <colin.campbell at ptfs-europe.com>


Signed-off-by: Nicole C. Engard <nengard at bywatersolutions.com>
---
 C4/Serials.pm |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/C4/Serials.pm b/C4/Serials.pm
index 1f8c170..20ae7a3 100644
--- a/C4/Serials.pm
+++ b/C4/Serials.pm
@@ -1634,7 +1634,9 @@ sub HasSubscriptionExpired {
         my $sth = $dbh->prepare($query);
         $sth->execute($subscriptionid);
         my ($res) = $sth->fetchrow;
-        return 0 unless $res;
+        if (!$res || $res=~m/^0000/) {
+            return 0;
+        }
         my @res                   = split( /-/, $res );
         my @endofsubscriptiondate = split( /-/, $expirationdate );
         return 2 if ( scalar(@res) != 3 || scalar(@endofsubscriptiondate) != 3 || not check_date(@res) || not check_date(@endofsubscriptiondate) );
-- 
1.7.2.3



More information about the Koha-patches mailing list