[wp-trac] [WordPress Trac] #3670: Removing CDATA close tag ( ]]> ) unbalances the CDATA block

WordPress Trac wp-trac at lists.automattic.com
Thu Jan 25 05:55:47 GMT 2007


#3670: Removing CDATA close tag ( ]]> ) unbalances the CDATA block
----------------------------+-----------------------------------------------
 Reporter:  scenic          |       Owner:  anonymous
     Type:  defect          |      Status:  new      
 Priority:  low             |   Milestone:  2.1.1    
Component:  Administration  |     Version:           
 Severity:  normal          |    Keywords:           
----------------------------+-----------------------------------------------
 I'm
 not sure if this is a bug per se, but it breaks included JS in my
 posts that are escaped with a CDATA section.  I've basically commented
 out the following line in the_content() every time I upgrade:

 //$content = str_replace(']]>', ']]>', $content);

 A user on the wp-testers list indicated that this was part of making sure
 that included CDATA blocks didn't break RSS feeds.  I don't use CDATA
 sections directly in my RSS feeds, so I haven't tested this.  In my
 particular case, the JS is used to embed Flash movies (e.g. YouTube
 videos) in an XHTML compliant way (without embed tags).  I have a custom
 plugin I've written that strips out the JS and replaces it with the embed
 tag in the RSS feed.

 Perhaps we should use a flag to activate this when the app is going
 through a feed.  Ideally, though, it would simply be removed.  Odds are
 that the CDATA block is being used for a JS block in a post body, and
 since most RSS aggregators don't allow JS by default, it would be safe to
 simply remove CDATA blogs if is_feed() is set.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3670>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list