[wp-trac] [WordPress Trac] #59082: Titles and descriptions in RSS feeds need to use CDATA to encode special characters.
WordPress Trac
noreply at wordpress.org
Sat Aug 12 04:03:44 UTC 2023
#59082: Titles and descriptions in RSS feeds need to use CDATA to encode special
characters.
--------------------------+------------------------------
Reporter: jsmoriss | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Feeds | Version: 6.3
Severity: major | Resolution:
Keywords: | Focuses:
--------------------------+------------------------------
Comment (by jsmoriss):
An example HTML entity fix that passes the W3C validator without using
CDATA is:
{{{
add_filter( 'get_wp_title_rss', 'fix_document_title_for_rss' );
function fix_document_title_for_rss( $itle ) {
return ent2ncr( $title );
}
}}}
The get_wp_title_rss() function could be modified to apply ent2ncr() on
all results from the 'get_wp_title_rss' filter - for example:
{{{
return ent2ncr( apply_filters( 'get_wp_title_rss',
wp_get_document_title(), $deprecated ) );
}}}
js.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/59082#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list