From db00aaa8859bbb384e37b9305cf83f495f479c4c Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Thu, 21 Jun 2012 11:38:39 -0400 Subject: [PATCH] Assume that future checkins are junk input This can happen with SIP2 clients with badly set clocks. Signed-off-by: Thomas Berezansky Signed-off-by: Ben Shum --- Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index ef2b361b9b..c7c8e9a093 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -3502,7 +3502,12 @@ sub checkin_handle_backdate { my $new_date = DateTime::Format::ISO8601->new->parse_datetime($bd); $new_date->set_hour($original_date->hour()); $new_date->set_minute($original_date->minute()); - $bd = cleanse_ISO8601($new_date->datetime()); + if ($new_date >= DateTime->now) { + # We can't say that the item will be checked in later...so assume someone's clock is wrong instead. + $bd = undef; + } else { + $bd = cleanse_ISO8601($new_date->datetime()); + } $self->backdate($bd); return undef; -- 2.11.0