diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 7f18033..3a7f3bb 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -105,8 +105,18 @@ function blog_form(&$node) { */ function blog_view($node, $teaser = FALSE, $page = FALSE) { if ($page) { - // Breadcrumb navigation. l() escapes the title, so we should not escape !name. - drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('Blogs'), 'blog'), l(t("!name's blog", array('!name' => $node->name)), 'blog/'. $node->uid))); + if (empty($node->name)) { + // Breadcrumb navigation. l() escapes the title, so we should not escape !name. + drupal_set_breadcrumb( + array( + l(t('Home'), NULL), + l(t('Blogs'), 'blog'), + ) + ); + } else { + // Breadcrumb navigation. l() escapes the title, so we should not escape !name. + drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('Blogs'), 'blog'), l(t("!name's blog", array('!name' => $node->name)), 'blog/'. $node->uid))); + } } return node_prepare($node, $teaser); } @@ -117,7 +127,7 @@ function blog_view($node, $teaser = FALSE, $page = FALSE) { function blog_link($type, $node = NULL, $teaser = FALSE) { $links = array(); - if ($type == 'node' && $node->type == 'blog') { + if ($type == 'node' && $node->type == 'blog' && !empty($node->name)) { if (arg(0) != 'blog' || arg(1) != $node->uid) { // This goes to l() and therefore escapes !username in both the title and attributes. $links['blog_usernames_blog'] = array(