From c3918bfee9e86c842f4d80fd8b2baddb99268412 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Mon, 22 Oct 2018 08:31:04 +0800 Subject: [PATCH] MDL-63289 message: Remove unused global --- message/classes/api.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/message/classes/api.php b/message/classes/api.php index 9eb9759c706..b2bd57aae3a 100644 --- a/message/classes/api.php +++ b/message/classes/api.php @@ -1685,8 +1685,6 @@ class api { * @return bool true if recipient hasn't blocked sender and sender can contact to recipient, false otherwise. */ protected static function can_contact_user(\stdClass $recipient, \stdClass $sender) : bool { - global $CFG; - if (has_capability('moodle/site:messageanyuser', \context_system::instance(), $sender->id)) { // The sender has the ability to contact any user across the entire site. return true;