From 5d8649480857a304c0bee1c36701636ab6b12ced Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Wed, 1 Mar 2017 09:18:08 +0800 Subject: [PATCH] MDL-53978 core: Improve cache usage when no callbacks are defined --- lib/moodlelib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 8bdfa86a297..2543b87d630 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -7484,8 +7484,9 @@ function get_plugins_with_function($function, $file = 'lib.php', $include = true // Including both although I doubt that we will find two functions definitions with the same name. // Clearning the filename as cache_helper::hash_key only allows a-zA-Z0-9_. $key = $function . '_' . clean_param($file, PARAM_ALPHA); + $pluginfunctions = $cache->get($key); - if ($pluginfunctions = $cache->get($key)) { + if ($pluginfunctions !== false) { // Checking that the files are still available. foreach ($pluginfunctions as $plugintype => $plugins) {