Index: wp-includes/comment-template.php
===================================================================
--- wp-includes/comment-template.php	(revision 24833)
+++ wp-includes/comment-template.php	(working copy)
@@ -746,18 +746,22 @@
 	if ( false !== stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') )
 		return;
 
-	echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+	$permalink = apply_filters( 'the_permalink', get_permalink() );
+
+	$output  = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 			xmlns:dc="http://purl.org/dc/elements/1.1/"
 			xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
 		<rdf:Description rdf:about="';
-	the_permalink();
-	echo '"'."\n";
-	echo '    dc:identifier="';
-	the_permalink();
-	echo '"'."\n";
-	echo '    dc:title="'.str_replace('--', '&#x2d;&#x2d;', wptexturize(strip_tags(get_the_title()))).'"'."\n";
-	echo '    trackback:ping="'.get_trackback_url().'"'." />\n";
-	echo '</rdf:RDF>';
+	$output .= esc_url( $permalink );
+	$output .= '"'."\n";
+	$output .= '    dc:identifier="';
+	$output .= esc_url( $permalink );
+	$output .= '"'."\n";
+	$output .= '    dc:title="' . esc_attr( strip_tags( get_the_title() ) ) . '"' . "\n";
+	$output .= '    trackback:ping="' . esc_url( get_trackback_url() ) . '"' . " />\n";
+	$output .= '</rdf:RDF>';
+
+	echo str_replace( '--', '&#x2d;&#x2d;', $output );
 }
 
 /**
