From 116c4d55eee295fe77d1cb96d0b290094255cedb Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Fri, 9 May 2014 13:29:41 +1200 Subject: [PATCH] CONTRIB-4864 prevent PHP warning when checking var --- locallib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locallib.php b/locallib.php index 230baab..ace0f42 100644 --- a/locallib.php +++ b/locallib.php @@ -1073,7 +1073,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);