CONTRIB-4864 prevent PHP warning when checking var
authorDan Marsden <dan@danmarsden.com>
Fri, 9 May 2014 01:29:41 +0000 (13:29 +1200)
committerDan Marsden <dan@danmarsden.com>
Fri, 9 May 2014 01:30:23 +0000 (13:30 +1200)
locallib.php

index 230baab..ace0f42 100644 (file)
@@ -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);