diff options
author | Sem <sembrestels@riseup.net> | 2012-12-24 00:36:57 +0100 |
---|---|---|
committer | Sem <sembrestels@riseup.net> | 2012-12-24 00:36:57 +0100 |
commit | 4c5529e8ab898451d02fb93dc77032d1bedad997 (patch) | |
tree | 2c2766c6bb3d72345bdcbc2797e145906b211895 /mod/blog/views | |
parent | 6623571b615fc5c9d1b82e2607de4cdaee8a818b (diff) | |
download | elgg-4c5529e8ab898451d02fb93dc77032d1bedad997.tar.gz elgg-4c5529e8ab898451d02fb93dc77032d1bedad997.tar.bz2 |
Checking if pageowner exists before using it.
Diffstat (limited to 'mod/blog/views')
-rw-r--r-- | mod/blog/views/default/blog/sidebar/archives.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/mod/blog/views/default/blog/sidebar/archives.php b/mod/blog/views/default/blog/sidebar/archives.php index 3d8f28ca4..dc7f123b4 100644 --- a/mod/blog/views/default/blog/sidebar/archives.php +++ b/mod/blog/views/default/blog/sidebar/archives.php @@ -3,9 +3,12 @@ * Blog archives */ -$loggedin_user = elgg_get_logged_in_user_entity(); $page_owner = elgg_get_page_owner_entity(); +if (!$page_owner) { + return; +} + if (elgg_instanceof($page_owner, 'user')) { $url_segment = 'blog/archive/' . $page_owner->username; } else { @@ -15,7 +18,7 @@ if (elgg_instanceof($page_owner, 'user')) { // This is a limitation of the URL schema. if ($page_owner && $vars['page'] != 'friends') { $dates = get_entity_dates('object', 'blog', $page_owner->getGUID()); - + if ($dates) { $title = elgg_echo('blog:archives'); $content = '<ul class="blog-archives">'; @@ -31,4 +34,4 @@ if ($page_owner && $vars['page'] != 'friends') { echo elgg_view_module('aside', $title, $content); } -}
\ No newline at end of file +} |