From 75a5ae666eb9ec89898e81bf9429d361551126fe Mon Sep 17 00:00:00 2001 From: brettp Date: Tue, 26 Jan 2010 01:22:12 +0000 Subject: Fixes #1454: Applied Cash's patch. Bad plugins are automatically disabled and a notice is displayed instead of breaking the site. git-svn-id: http://code.elgg.org/elgg/trunk@3841 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/plugins.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'engine/lib') diff --git a/engine/lib/plugins.php b/engine/lib/plugins.php index 0c8af5497..76692b447 100644 --- a/engine/lib/plugins.php +++ b/engine/lib/plugins.php @@ -228,7 +228,14 @@ function load_plugins() { if (is_plugin_enabled($mod)) { if (file_exists($CONFIG->pluginspath . $mod)) { if (!include($CONFIG->pluginspath . $mod . "/start.php")) { - throw new PluginException(sprintf(elgg_echo('PluginException:MisconfiguredPlugin'), $mod)); + // automatically disable the bad plugin + disable_plugin($mod); + + // register error rather than rendering the site unusable with exception + register_error(sprintf(elgg_echo('PluginException:MisconfiguredPlugin'), $mod)); + + // continue loading remaining plugins + continue; } if (!$cached_view_paths) { -- cgit v1.2.3