From: Dan Marsden Date: Fri, 9 May 2014 01:29:41 +0000 (+1200) Subject: CONTRIB-4864 prevent PHP warning when checking var X-Git-Url: https://git.cameron1729.xyz/?a=commitdiff_plain;h=cf9f20741dced688b3bca906116f630e401a20ba;p=moodle-mod_attendance.git CONTRIB-4864 prevent PHP warning when checking var --- diff --git a/locallib.php b/locallib.php index 912703d..53988ef 100644 --- a/locallib.php +++ b/locallib.php @@ -1091,7 +1091,7 @@ class attendance { public function get_user_taken_sessions_count($userid) { if (!array_key_exists($userid, $this->usertakensesscount)) { - if ($this->pageparams->startdate && $this->pageparams->enddate) { + if (!empty($this->pageparams->startdate) && !empty($this->pageparams->enddate)) { $this->usertakensesscount[$userid] = att_get_user_taken_sessions_count($this->id, $this->course->startdate, $userid, $this->cm, $this->pageparams->startdate, $this->pageparams->enddate); } else { $this->usertakensesscount[$userid] = att_get_user_taken_sessions_count($this->id, $this->course->startdate, $userid, $this->cm);