From 61d24f4b7b4fd4d5e960593a25a0d96b11891ff0 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 5 Nov 2011 19:15:42 -0400 Subject: Fixes #4024 fixed a lot of notices - enough for this release - found a few bugs --- engine/lib/elgglib.php | 8 ++++++-- engine/lib/navigation.php | 8 ++++++-- engine/lib/views.php | 9 +++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 10804fdca..47ca157e1 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -1475,8 +1475,12 @@ function elgg_http_url_is_identical($url1, $url2, $ignore_params = array('offset $url1_info = parse_url($url1); $url2_info = parse_url($url2); - $url1_info['path'] = trim($url1_info['path'], '/'); - $url2_info['path'] = trim($url2_info['path'], '/'); + if (isset($url1_info['path'])) { + $url1_info['path'] = trim($url1_info['path'], '/'); + } + if (isset($url2_info['path'])) { + $url2_info['path'] = trim($url2_info['path'], '/'); + } // compare basic bits $parts = array('scheme', 'host', 'path'); diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php index aaf9fb544..176790188 100644 --- a/engine/lib/navigation.php +++ b/engine/lib/navigation.php @@ -207,7 +207,7 @@ function elgg_register_title_button($handler = null, $name = 'add') { */ function elgg_push_breadcrumb($title, $link = NULL) { global $CONFIG; - if (!is_array($CONFIG->breadcrumbs)) { + if (!isset($CONFIG->breadcrumbs)) { $CONFIG->breadcrumbs = array(); } @@ -242,7 +242,11 @@ function elgg_pop_breadcrumb() { function elgg_get_breadcrumbs() { global $CONFIG; - return (is_array($CONFIG->breadcrumbs)) ? $CONFIG->breadcrumbs : array(); + if (isset($CONFIG->breadcrumbs) && is_array($CONFIG->breadcrumbs)) { + return $CONFIG->breadcrumbs; + } + + return array(); } /** diff --git a/engine/lib/views.php b/engine/lib/views.php index 6ca68ac8c..0f806b8be 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -743,7 +743,11 @@ function elgg_view_menu($menu_name, array $vars = array()) { $sort_by = elgg_extract('sort_by', $vars, 'text'); - $menu = $CONFIG->menus[$menu_name]; + if (isset($CONFIG->menus[$menu_name])) { + $menu = $CONFIG->menus[$menu_name]; + } else { + $menu = array(); + } // Give plugins a chance to add menu items just before creation. // This supports dynamic menus (example: user_hover). @@ -1198,7 +1202,8 @@ function elgg_view_image_block($image, $body, $vars = array()) { * @since 1.8.0 */ function elgg_view_module($type, $title, $body, $vars = array()) { - $vars['class'] .= " elgg-module-$type"; + + $vars['class'] = elgg_extract('class', $vars, '') . " elgg-module-$type"; $vars['title'] = $title; $vars['body'] = $body; return elgg_view('page/components/module', $vars); -- cgit v1.2.3