Permalink
Browse files

if starttime and endtime are empty, set them to zero

  • Loading branch information...
1 parent 729b2df commit abe2308eabd34cc837c3395495fc3e9239e03d12 gbateson committed Jan 13, 2006
Showing with 9 additions and 4 deletions.
  1. +9 −4 mod/hotpot/attempt.php
View
@@ -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;

0 comments on commit abe2308

Please sign in to comment.