diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-08-27 12:10:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-27 12:10:16 +0200 |
commit | 109ebf318f2f71d6c5f3690da3c16d0b03d982bb (patch) | |
tree | f0a333e9e009d78d59c1e4823f766625bc2bb255 /application/plugin | |
parent | af41d5ab5d2bd3ba64d052c997bc6afa6966a63c (diff) | |
parent | 7e3dc0ba98bf019c2804e5c74fb6061b16fb712f (diff) | |
download | Shaarli-109ebf318f2f71d6c5f3690da3c16d0b03d982bb.tar.gz Shaarli-109ebf318f2f71d6c5f3690da3c16d0b03d982bb.tar.zst Shaarli-109ebf318f2f71d6c5f3690da3c16d0b03d982bb.zip |
Merge pull request #1516 from ArthurHoaro/feature/plugin-incompatibility
Better handling of plugin incompatibility
Diffstat (limited to 'application/plugin')
-rw-r--r-- | application/plugin/PluginManager.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/application/plugin/PluginManager.php b/application/plugin/PluginManager.php index b3e8b2f8..2d93cb3a 100644 --- a/application/plugin/PluginManager.php +++ b/application/plugin/PluginManager.php | |||
@@ -116,7 +116,12 @@ class PluginManager | |||
116 | $hookFunction = $this->buildHookName($hook, $plugin); | 116 | $hookFunction = $this->buildHookName($hook, $plugin); |
117 | 117 | ||
118 | if (function_exists($hookFunction)) { | 118 | if (function_exists($hookFunction)) { |
119 | $data = call_user_func($hookFunction, $data, $this->conf); | 119 | try { |
120 | $data = call_user_func($hookFunction, $data, $this->conf); | ||
121 | } catch (\Throwable $e) { | ||
122 | $error = $plugin . t(' [plugin incompatibility]: ') . $e->getMessage(); | ||
123 | $this->errors = array_unique(array_merge($this->errors, [$error])); | ||
124 | } | ||
120 | } | 125 | } |
121 | } | 126 | } |
122 | } | 127 | } |