From 15af164f6991db39fb49efa008d4854359746cbc Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 14 Nov 2021 11:50:55 +0300 Subject: [PATCH] pluginhost: add a hack to not crash on an incompatible plugin more than once (per login) - UGLY --- classes/pluginhost.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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;