MDL-33340 completion: Incorrect logic in hidden field check
authorAnkit Agarwal <ankit@moodle.com>
Mon, 25 Jun 2012 06:10:42 +0000 (14:10 +0800)
committerDan Poltawski <dan@moodle.com>
Mon, 7 Jan 2013 02:37:38 +0000 (10:37 +0800)
Credit to Jody Steele

report/outline/index.php

index c7abae3..7c82e66 100644 (file)
@@ -42,7 +42,7 @@ add_to_log($course->id, 'course', 'report outline', "report/outline/index.php?id
 $showlastaccess = true;
 $hiddenfields = explode(',', $CFG->hiddenuserfields);
 
-if (array_search('lastaccess', $hiddenfields) and !has_capability('moodle/user:viewhiddendetails', $context)) {
+if (array_search('lastaccess', $hiddenfields) !== false and !has_capability('moodle/user:viewhiddendetails', $context)) {
     $showlastaccess = false;
 }