From 870f19afe09d53152f1b995bfb5eecbab5c84fa6 Mon Sep 17 00:00:00 2001 From: Kenji ITO Date: Sun, 16 Sep 2018 14:39:50 +0900 Subject: [PATCH] Fixed a bug where PLG_isModerator didn't work properly --- system/lib-plugins.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/system/lib-plugins.php b/system/lib-plugins.php index 3427187b0..7f6e28cab 100644 --- a/system/lib-plugins.php +++ b/system/lib-plugins.php @@ -396,10 +396,26 @@ function PLG_enableStateChange($type, $enable) /** * Checks to see if user is a plugin moderator * Geeklog is asking if the user is a moderator for any installed plugins. + * + * @return bool */ function PLG_isModerator() { - PLG_callFunctionForAllPlugins('ismoderator'); + global $_PLUGINS; + + foreach ($_PLUGINS as $piName) { + $function = 'plugin_ismoderator_' . $piName; + if (is_callable($function) && $function()) { + return true; + } + } + + $function = 'CUSTOM_ismoderator'; + if (is_callable($function) && $function()) { + return true; + } + + return false; } /**