Home > Web Programming > Drupal RSS feeds in Internet Explorer 7

Drupal RSS feeds in Internet Explorer 7

November 21, 2006 Leave a comment Go to comments

Anybody who’s used Internet Explorer 7 for reading RSS feeds has probably noticed something annoying: it doesn’t support feeds with DTDs (Document Type Definitions).

Ironically, Outlook supports RSS feeds with DTDs but the functionality was conservatively disabled in IE7 due to concerns about Denial of Service attacks (reference: Internet Explorer Chats (12 October 2006)).

Here’s a quick hack to make RSS feeds genreated by Drupal work in IE7:

    1. Open modules/node.module
    2. Towards the end of the function node_feed(), comment out the DTD line as shown:
      $output = "<?xml version=\"1.0\" encoding=\"utf-8\"?>
      // Comment out this line to disable DTD declaration
      // $output .= "<!DOCTYPE rss [<!ENTITY % HTMLlat1 PUBLIC \"-//W3C//ENTITIES Latin 1 for XHTML//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent\">]>
      // ";
      $output .= "<rss version=\"". $channel["version"] . "\" xml:base=\"". $base_url ."\">
      $output .= format_rss_channel($channel['title'], $channel['link'], $channel['description'], $items, $channel['language']);
      $output .= "</rss>

      In Drupal 4.6.5, this can be found approximately on line 1172 of the code.

Now go to your feed URL again, and you should be able to successfully subscribe in Internet Explorer 7. Hope this helps somebody!

  1. No comments yet.
  1. No trackbacks yet.

Share your thoughts! Note: to post source code, enclose it in [code lang=...] [/code] tags. Valid values for 'lang' are cpp, csharp, xml, javascript, php etc. To post compiler errors or other text that is best read monospaced, use 'text' as the value for lang.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: