[wp-hackers] [Patch] HTTP Content-type for the various RSS/ATOM
feeds.
Ben Hyde
bhyde at pobox.com
Tue Aug 10 18:58:13 UTC 2004
The patch below changes the Content-type of the various subscription
feeds from the olde txt/xml to the more modern cooler application/xml.
This has the benefit that the feed validator[1] doesn't complain about
how the server is implying that the content is encoded as US-ASCII
while the content XML announces it is UTF-8. - ben
[1]
http://feeds.archive.org/validator/check.cgi?
url=http%3A%2F%2Fenthusiasm.cozy.org%2Ffeed%2Frss2
Index: wp-commentsrss2.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-commentsrss2.php,v
retrieving revision 1.17
diff -u -3 -r1.17 wp-commentsrss2.php
--- wp-commentsrss2.php 24 May 2004 08:22:18 -0000 1.17
+++ wp-commentsrss2.php 10 Aug 2004 18:52:44 -0000
@@ -3,7 +3,7 @@
require('wp-blog-header.php');
}
-header('Content-type: text/xml', true);
+header('Content-type: application/xml', true);
echo '<?xml version="1.0"
encoding="'.get_settings('blog_charset').'"?'.'>';
?>
Index: wp-links-opml.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-links-opml.php,v
retrieving revision 1.7
diff -u -3 -r1.7 wp-links-opml.php
--- wp-links-opml.php 24 May 2004 08:22:18 -0000 1.7
+++ wp-links-opml.php 10 Aug 2004 18:52:45 -0000
@@ -1,7 +1,7 @@
<?php
$blog = 1; // Your blog's ID
$doing_rss = 1;
-header('Content-type: text/xml', true);
+header('Content-type: application/xml', true);
require('wp-blog-header.php');
$link_cat = $_GET['link_cat'];
Index: wp-locations.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-locations.php,v
retrieving revision 1.4
diff -u -3 -r1.4 wp-locations.php
--- wp-locations.php 1 Mar 2004 06:13:31 -0000 1.4
+++ wp-locations.php 10 Aug 2004 18:52:45 -0000
@@ -1,5 +1,5 @@
<?php $blog = 1; // enter your blog's ID
-header('Content-type: text/xml');
+header('Content-type: application/xml');
include('wp-blog-header.php');
?><?php echo "<?xml version=\"1.0\"?".">\n"; ?>
<travels>
Index: wp-rss.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-rss.php,v
retrieving revision 1.18
diff -u -3 -r1.18 wp-rss.php
--- wp-rss.php 24 May 2004 18:24:12 -0000 1.18
+++ wp-rss.php 10 Aug 2004 18:52:45 -0000
@@ -6,7 +6,7 @@
require('wp-blog-header.php');
}
-header('Content-type: text/xml', true);
+header('Content-type: application/xml', true);
$more = 1;
?>
Index: wp-rss2.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-rss2.php,v
retrieving revision 1.25
diff -u -3 -r1.25 wp-rss2.php
--- wp-rss2.php 27 Jul 2004 13:49:05 -0000 1.25
+++ wp-rss2.php 10 Aug 2004 18:52:45 -0000
@@ -6,7 +6,7 @@
require('wp-blog-header.php');
}
-header('Content-type: text/xml', true);
+header('Content-type: application/xml', true);
$more = 1;
?>
More information about the hackers
mailing list