From 51ad3e70d335eeb18e6c7c4fc3b2651a6c95e73f Mon Sep 17 00:00:00 2001 From: "Fedor A. Fetisov" Date: Fri, 22 Sep 2017 17:27:34 +0300 Subject: [PATCH] Fix unhandled error in plugins list discovering --- src/mibew/libs/classes/Mibew/Plugin/Utils.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mibew/libs/classes/Mibew/Plugin/Utils.php b/src/mibew/libs/classes/Mibew/Plugin/Utils.php index 43db316c..7326569a 100644 --- a/src/mibew/libs/classes/Mibew/Plugin/Utils.php +++ b/src/mibew/libs/classes/Mibew/Plugin/Utils.php @@ -48,7 +48,12 @@ class Utils '/plugins/*/Mibew/Plugin/*/Plugin.php' ); - foreach (glob($pattern) as $plugin_file) { + $plugin_files = glob($pattern); + if ($plugin_files === FALSE) { + // TODO: Maybe one should raise some exception here + return $plugins; + } + foreach ($plugin_files as $plugin_file) { // Build plugin's name and make sure the plugin exists. $parts = array_reverse(explode(DIRECTORY_SEPARATOR, $plugin_file)); $plugin_name = $parts[4] . ':' . $parts[1];