From abe2308eabd34cc837c3395495fc3e9239e03d12 Mon Sep 17 00:00:00 2001 From: gbateson Date: Fri, 13 Jan 2006 07:57:50 +0000 Subject: [PATCH] if starttime and endtime are empty, set them to zero --- mod/hotpot/attempt.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mod/hotpot/attempt.php b/mod/hotpot/attempt.php index ad06a88652a..fd495c03d13 100644 --- a/mod/hotpot/attempt.php +++ b/mod/hotpot/attempt.php @@ -35,12 +35,17 @@ $attempt->starttime = optional_param('starttime', NULL, PARAM_ALPHA); $attempt->timefinish = $time; - if ($attempt->endtime) { - $attempt->endtime = strtotime($attempt->endtime); - } - if ($attempt->starttime) { + // convert times, if necessary + if (empty($attempt->starttime)) { + $attempt->starttime = 0; + } else { $attempt->starttime = strtotime($attempt->starttime); } + if (empty($attempt->endtime)) { + $attempt->endtime = 0; + } else { + $attempt->endtime = strtotime($attempt->endtime); + } // set clickreportid, (for click reporting) $attempt->clickreportid = $attempt->id;