aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-01-26 01:22:12 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-01-26 01:22:12 +0000
commit75a5ae666eb9ec89898e81bf9429d361551126fe (patch)
tree4cfae1af28cc794c2c478b2c0be27dd0c184fdef
parentbbfd05c0c40703399e633151713a09c6f9fbe9a0 (diff)
downloadelgg-75a5ae666eb9ec89898e81bf9429d361551126fe.tar.gz
elgg-75a5ae666eb9ec89898e81bf9429d361551126fe.tar.bz2
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
-rw-r--r--CHANGES.txt1
-rw-r--r--engine/lib/plugins.php9
-rw-r--r--languages/en.php2
3 files changed, 10 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 8b3abe80f..5590e0bec 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,7 @@ http://code.elgg.org/elgg/.....
* Unit tests added to System diagnostics.
* Debug values output to screen when enabled in admin settings.
* Users can now log in from multiple computers or browsers concurrently.
+ * Misconfigured plugins no longer break the site. #1454
* New search system.
Bugfixes:
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) {
diff --git a/languages/en.php b/languages/en.php
index 144d9579a..7da28a206 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -54,7 +54,7 @@ $english = array(
'InvalidClassException:NotValidElggStar' => "GUID:%d is not a valid %s",
- 'PluginException:MisconfiguredPlugin' => "%s is a misconfigured plugin.",
+ 'PluginException:MisconfiguredPlugin' => "%s is a misconfigured plugin. It has been disabled. Please see the Elgg wiki for possible causes.",
'InvalidParameterException:NonElggUser' => "Passing a non-ElggUser to an ElggUser constructor!",