From 47148151233192a81201cbc1ffc77c980a4df431 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Mon, 31 Jan 2011 22:35:17 +0100 Subject: [PATCH] MDL-25981 fix inverted instanceof in require_login --- lib/moodlelib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index dd78d2400cf..ac2374fad63 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -2315,7 +2315,7 @@ function require_login($courseorid = NULL, $autologinguest = true, $cm = NULL, $ throw new coding_exception('course and cm parameters in require_login() call do not match!!'); } // make sure we have a $cm from get_fast_modinfo as this contains activity access details - if ($cm instanceof cm_info) { + if (!($cm instanceof cm_info)) { // note: nearly all pages call get_fast_modinfo anyway and it does not make any // db queries so this is not really a performance concern, however it is obviously // better if you use get_fast_modinfo to get the cm before calling this. -- 2.43.0