Make RSS 2.0 comment feed GUIDs immutable. fixes #5072

git-svn-id: http://svn.automattic.com/wordpress/trunk@6742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2008-02-06 22:33:21 +00:00
parent eabaabd76b
commit 5b22db23d1
2 changed files with 14 additions and 1 deletions

View File

@ -47,7 +47,7 @@ if ( have_comments() ) : while ( have_comments() ) : the_comment();
<link><?php comment_link() ?></link>
<dc:creator><?php echo get_comment_author_rss() ?></dc:creator>
<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_comment_time('Y-m-d H:i:s', true), false); ?></pubDate>
<guid><?php comment_link() ?></guid>
<guid isPermaLink="false"><?php comment_guid() ?></guid>
<?php if (!empty($comment_post->post_password) && $_COOKIE['wp-postpass'] != $comment_post->post_password) : ?>
<description><?php _e('Protected Comments: Please enter your password to view comments.'); ?></description>
<content:encoded><![CDATA[<?php echo get_the_password_form() ?>]]></content:encoded>

View File

@ -79,6 +79,19 @@ function the_permalink_rss() {
}
function comment_guid() {
echo get_comment_guid();
}
function get_comment_guid() {
global $comment;
if ( !is_object($comment) )
return false;
return get_the_guid($comment->comment_post_ID) . '#comment-' . $comment->comment_ID;
}
function comment_link() {
echo get_comment_link();
}