From 351a8276712ddeb5c6f2d4cec1fe386fd6f5d841 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 --- .../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 b39068891d..5f7386040a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -3637,7 +3637,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.43.2