summaryrefslogtreecommitdiff
path: root/modules/node/node.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-03-06 16:17:48 +0000
committerDries Buytaert <dries@buytaert.net>2004-03-06 16:17:48 +0000
commitccc9276f45705221a715b25c7dca4edf9a9c689c (patch)
tree28f91856b4fd0cc470c36795350602e5d94a122a /modules/node/node.module
parent8ebedbaa2bc099bd3295a11eebb5e37ebc5f59f4 (diff)
downloadbrdo-ccc9276f45705221a715b25c7dca4edf9a9c689c.tar.gz
brdo-ccc9276f45705221a715b25c7dca4edf9a9c689c.tar.bz2
- Patch #4902 by Goba: fix URLs in RSS feeds.
+ Make all channel links absolute. + Always set the $base_url as xml:base, thus providing a solid base for relative URLs.
Diffstat (limited to 'modules/node/node.module')
-rw-r--r--modules/node/node.module6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/node/node.module b/modules/node/node.module
index 71cfee864..3e1a62155 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -994,8 +994,8 @@ function node_feed($nodes = 0, $channel = array()) {
** A generic function for generating RSS feeds from a set of nodes.
** - $nodes should be an object as returned by db_query() which contains
** the nid field.
- ** - $channel is an associative array containing title, link, and
- ** description keys.
+ ** - $channel is an associative array containing title, link,
+ ** description and other keys. The link should be an absolute URL.
*/
if (!$nodes) {
@@ -1023,7 +1023,7 @@ function node_feed($nodes = 0, $channel = array()) {
$output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$output .= "<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC \"-//W3C//ENTITIES Latin 1 for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\">]>\n";
- $output .= "<rss version=\"". $channel["version"] . "\" xml:base=\"". $channel["link"] . "\">\n";
+ $output .= "<rss version=\"". $channel["version"] . "\" xml:base=\"". $base_url ."\">\n";
$output .= format_rss_channel($channel['title'], $channel['link'], $channel['description'], $items, $channel['language']);
$output .= "</rss>\n";