pluginhost: catch errors while loading plugin source code

This commit is contained in:
Andrew Dolgov 2021-02-08 12:14:12 +03:00
parent 4165834f80
commit 20b56b5b23
1 changed files with 6 additions and 1 deletions

View File

@ -210,7 +210,12 @@ class PluginHost {
}
if (!isset($this->plugins[$class])) {
if (file_exists($file)) require_once $file;
try {
if (file_exists($file)) require_once $file;
} catch (Error $err) {
user_error($err, E_USER_WARNING);
continue;
}
if (class_exists($class) && is_subclass_of($class, "Plugin")) {