summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-11-14 11:50:55 +0300
committerAndrew Dolgov <[email protected]>2021-11-14 11:50:55 +0300
commit15af164f6991db39fb49efa008d4854359746cbc (patch)
tree76ec30b75ffe705cf58ab48cc344eec7f86bc1b7 /classes
parent0a2dcacbcf01e1ebb225570fb99811c4215c6ea9 (diff)
pluginhost: add a hack to not crash on an incompatible plugin more than once (per login) - UGLY
Diffstat (limited to 'classes')
-rwxr-xr-xclasses/pluginhost.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/classes/pluginhost.php b/classes/pluginhost.php
index 173a75611..7688a6d0d 100755
--- a/classes/pluginhost.php
+++ b/classes/pluginhost.php
@@ -431,8 +431,20 @@ class PluginHost {
}
if (!isset($this->plugins[$class])) {
+
+ // WIP hack
+ // we can't catch incompatible method signatures via Throwable
+ // maybe also auto-disable user plugin in this situation? idk -fox
+ if ($_SESSION["plugin_blacklist.$class"] ?? false) {
+ user_error("Plugin $class has caused a PHP Fatal Error so it won't be loaded again in this session.", E_USER_NOTICE);
+ continue;
+ }
+
try {
+ $_SESSION["plugin_blacklist.$class"] = true;
require_once $file;
+ $_SESSION["plugin_blacklist.$class"] = false;
+
} catch (Error $err) {
user_error($err, E_USER_WARNING);
continue;