MDL-60281 general: create_function is deprecated in PHP7.2

This commit is contained in:
Marina Glancy
2017-10-16 09:37:19 +08:00
parent 2abb1e888c
commit 484b43f456
17 changed files with 75 additions and 34 deletions
+4 -3
View File
@@ -1866,7 +1866,7 @@ abstract class admin_setting {
}
$callbackfunction = $this->updatedcallback;
if (!empty($callbackfunction) and function_exists($callbackfunction)) {
if (!empty($callbackfunction) and is_callable($callbackfunction)) {
$callbackfunction($this->get_full_name());
}
return true;
@@ -5206,8 +5206,9 @@ class admin_setting_special_coursecontact extends admin_setting_pickroles {
parent::__construct('coursecontact', get_string('coursecontact', 'admin'),
get_string('coursecontact_desc', 'admin'),
array('editingteacher'));
$this->set_updatedcallback(create_function('',
"cache::make('core', 'coursecontacts')->purge();"));
$this->set_updatedcallback(function (){
cache::make('core', 'coursecontacts')->purge();
});
}
}