From: brettp Date: Wed, 29 Sep 2010 21:35:34 +0000 (+0000) Subject: Checking for $CONFIG->view_type before accessing it in elgg_is_valid_viewtype().... X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=c7bbda32e0025d085ce4f7700a1a5d85044e93f1;p=lorea%2Felgg.git Checking for $CONFIG->view_type before accessing it in elgg_is_valid_viewtype(). Prevents a notice during installation. git-svn-id: http://code.elgg.org/elgg/trunk@6977 36083f99-b078-4883-b0ff-0f9b5a30f544 --- diff --git a/engine/lib/views.php b/engine/lib/views.php index d10a296d8..6afcc5b76 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -1259,6 +1259,10 @@ function page_draw($title, $body, $page_shell = 'page_shells/default', $vars = a function elgg_is_valid_view_type($view_type) { global $CONFIG; + if (!isset($CONFIG->view_types) || !is_array($CONFIG->view_types)) { + return FALSE; + } + return in_array($view_type, $CONFIG->view_types); }