diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2005-05-31 21:14:27 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2005-05-31 21:14:27 +0000 |
commit | a597354bcb48536f2c7633d53c78fa931b186c20 (patch) | |
tree | 34e16a5b178faf3047963cddfdec084bfeceb8cb /modules/blog | |
parent | 025bca28aa1717459c811744704e0c1b514d1e1e (diff) | |
download | brdo-a597354bcb48536f2c7633d53c78fa931b186c20.tar.gz brdo-a597354bcb48536f2c7633d53c78fa931b186c20.tar.bz2 |
- Code cleanup: improve format_plural usage, add some missing placeholder/check calls, and introduce API for <link> tags.
Diffstat (limited to 'modules/blog')
-rw-r--r-- | modules/blog/blog.module | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/blog/blog.module b/modules/blog/blog.module index bbf4e4d22..31d4689b5 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -148,7 +148,10 @@ function blog_page_user($uid) { $output .= theme('pager', NULL, variable_get('default_nodes_main', 10)); $output .= theme('xml_icon', url("blog/$account->uid/feed")); - drupal_set_html_head('<link rel="alternate" type="application/rss+xml" title="RSS - '. $title .'" href="'. url("blog/$account->uid/feed") .'" />'); + drupal_add_link(array('rel' => 'alternate', + 'type' => 'application/rss+xml', + 'title' => t('RSS - %title', array('%title' => $title)), + 'href' => url("blog/$account->uid/feed"))); return $output; } else { @@ -172,7 +175,10 @@ function blog_page_last() { $output .= theme('pager', NULL, variable_get('default_nodes_main', 10)); $output .= theme('xml_icon', url('blog/feed')); - drupal_set_html_head('<link rel="alternate" type="application/rss+xml" title="RSS - blogs" href="'. url('blog/feed') .'" />'); + drupal_add_link(array('rel' => 'alternate', + 'type' => 'application/rss+xml', + 'title' => t('RSS - blogs'), + 'href' => url("blog/feed"))); return $output; } @@ -195,7 +201,8 @@ function blog_form(&$node) { if ($iid && $item = db_fetch_object(db_query('SELECT i.*, f.title as ftitle, f.link as flink FROM {aggregator_item} i, {aggregator_feed} f WHERE i.iid = %d AND i.fid = f.fid', $iid))) { $node->title = $item->title; - $node->body = "<a href=\"$item->link\">$item->title</a> - <em>". $item->description ."</em> [<a href=\"$item->flink\">$item->ftitle</a>]\n"; + // Note: $item->description has been validated on aggregation. + $node->body = '<a href="'. check_url($item->link) .'">'. check_plain($item->title) .'</a> - <em>'. $item->description .'</em> [<a href="'. check_url($item->flink) .'">'. check_plain($item->ftitle) ."</a>]\n"; } } |