]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4705 validate view type
authorCash Costello <cash.costello@gmail.com>
Sun, 15 Jul 2012 01:00:53 +0000 (21:00 -0400)
committerCash Costello <cash.costello@gmail.com>
Sun, 15 Jul 2012 01:00:53 +0000 (21:00 -0400)
engine/start.php

index 5f4bded45de4d3c66c9cac95e37caa16ed6e8f71..55b8ffa5bf30759fa330220dd91c8d84f94fd185 100644 (file)
@@ -100,6 +100,15 @@ elgg_trigger_event('boot', 'system');
 
 // Load the plugins that are active
 elgg_load_plugins();
+
+// @todo move loading plugins into a single boot function that replaces 'boot', 'system' event
+// and then move this code in there.
+// This validates the view type - first opportunity to do it is after plugins load.
+$view_type = elgg_get_viewtype();
+if (!elgg_is_valid_view_type($view_type)) {
+       elgg_set_viewtype('default');
+}
+
 // @todo deprecate as plugins can use 'init', 'system' event
 elgg_trigger_event('plugins_boot', 'system');