diff options
-rw-r--r-- | engine/classes/ElggPluginPackage.php | 2 | ||||
-rw-r--r-- | engine/lib/elgglib.php | 23 | ||||
-rw-r--r-- | engine/lib/metadata.php | 2 | ||||
-rw-r--r-- | engine/lib/views.php | 3 | ||||
-rw-r--r-- | engine/lib/xml.php | 4 |
5 files changed, 22 insertions, 12 deletions
diff --git a/engine/classes/ElggPluginPackage.php b/engine/classes/ElggPluginPackage.php index fd54ff731..422f777b9 100644 --- a/engine/classes/ElggPluginPackage.php +++ b/engine/classes/ElggPluginPackage.php @@ -221,7 +221,7 @@ class ElggPluginPackage { } // make sure nothing is providing something it conflicts or requires. - if ($dep['name'] == $name) { + if (isset($dep['name']) && $dep['name'] == $name) { $version_compare = version_compare($provide['version'], $dep['version'], $dep['comparison']); if ($version_compare) { diff --git a/engine/lib/elgglib.php b/engine/lib/elgglib.php index 497f25953..f925429de 100644 --- a/engine/lib/elgglib.php +++ b/engine/lib/elgglib.php @@ -875,12 +875,19 @@ function unregister_elgg_event_handler($event, $object_type, $callback) { function elgg_trigger_event($event, $object_type, $object = null) { global $CONFIG; - $events = array( - $CONFIG->events[$event][$object_type], - $CONFIG->events['all'][$object_type], - $CONFIG->events[$event]['all'], - $CONFIG->events['all']['all'], - ); + $events = array(); + if (isset($CONFIG->events[$event][$object_type])) { + $events[] = $CONFIG->events[$event][$object_type]; + } + if (isset($CONFIG->events['all'][$object_type])) { + $events[] = $CONFIG->events['all'][$object_type]; + } + if (isset($CONFIG->events[$event]['all'])) { + $events[] = $CONFIG->events[$event]['all']; + } + if (isset($CONFIG->events['all']['all'])) { + $events[] = $CONFIG->events['all']['all']; + } $args = array($event, $object_type, $object); @@ -1092,7 +1099,9 @@ function elgg_trigger_plugin_hook($hook, $type, $params = null, $returnvalue = n if (isset($CONFIG->hooks[$hook]['all'])) { $hooks[] = $CONFIG->hooks[$hook]['all']; } - $hooks[] = $CONFIG->hooks['all']['all']; + if (isset($CONFIG->hooks['all']['all'])) { + $hooks[] = $CONFIG->hooks['all']['all']; + } foreach ($hooks as $callback_list) { if (is_array($callback_list)) { diff --git a/engine/lib/metadata.php b/engine/lib/metadata.php index c15a163b7..0ae576328 100644 --- a/engine/lib/metadata.php +++ b/engine/lib/metadata.php @@ -854,7 +854,7 @@ $owner_guids = NULL) { } if (is_array($order_by_metadata)) { - if ((count($order_by_metadata) > 0) && !is_array($order_by_metadata[0])) { + if ((count($order_by_metadata) > 0) && !isset($order_by_metadata[0])) { // singleton, so fix $order_by_metadata = array($order_by_metadata); } diff --git a/engine/lib/views.php b/engine/lib/views.php index 364f4618e..c97a214a1 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -581,6 +581,7 @@ function extend_view($view, $view_name, $priority = 501, $viewtype = '') { */ function elgg_view_page($title, $body, $page_shell = 'default', $vars = array()) { + $messages = null; if (count_messages()) { // get messages - try for errors first $messages = system_messages(NULL, "error"); @@ -857,7 +858,7 @@ function elgg_view_annotation(ElggAnnotation $annotation, $full = true, $bypass * @return string The list of entities * @access private */ -function elgg_view_entity_list($entities, $count, $offset, $limit, $full_view = true, +function elgg_view_entity_list($entities, $count, $offset = 0, $limit = 10, $full_view = true, $list_type_toggle = true, $pagination = true) { if (!is_int($offset)) { diff --git a/engine/lib/xml.php b/engine/lib/xml.php index 0d0d83da0..55ea1b5ad 100644 --- a/engine/lib/xml.php +++ b/engine/lib/xml.php @@ -127,8 +127,8 @@ function xml_to_object($xml) { if ($tag['type'] == "complete" || $tag['type'] == "open") { $elements[$index] = new XmlElement; $elements[$index]->name = $tag['tag']; - $elements[$index]->attributes = $tag['attributes']; - $elements[$index]->content = $tag['value']; + $elements[$index]->attributes = elgg_get_array_value('attributes', $tag, ''); + $elements[$index]->content = elgg_get_array_value('value', $tag, ''); if ($tag['type'] == "open") { $elements[$index]->children = array(); |