X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Fplugin%2FPluginManager.php;h=2d93cb3a2173c58bada5803b8ca4fd522819991f;hb=refs%2Fpull%2F1516%2Fhead;hp=591a918098ee46a8d22d9643ebabbe7a9f0756b9;hpb=1b8620b1ad4e2c647ff2d032c8e7c6687b6647a1;p=github%2Fshaarli%2FShaarli.git diff --git a/application/plugin/PluginManager.php b/application/plugin/PluginManager.php index 591a9180..2d93cb3a 100644 --- a/application/plugin/PluginManager.php +++ b/application/plugin/PluginManager.php @@ -108,11 +108,20 @@ class PluginManager $data['_LOGGEDIN_'] = $params['loggedin']; } + if (isset($params['basePath'])) { + $data['_BASE_PATH_'] = $params['basePath']; + } + foreach ($this->loadedPlugins as $plugin) { $hookFunction = $this->buildHookName($hook, $plugin); if (function_exists($hookFunction)) { - $data = call_user_func($hookFunction, $data, $this->conf); + try { + $data = call_user_func($hookFunction, $data, $this->conf); + } catch (\Throwable $e) { + $error = $plugin . t(' [plugin incompatibility]: ') . $e->getMessage(); + $this->errors = array_unique(array_merge($this->errors, [$error])); + } } } }