[wp-trac] [WordPress Trac] #27134: the_content() contains unexpected hard coded string replacement

WordPress Trac noreply at wordpress.org
Sat Feb 15 18:02:20 UTC 2014


#27134: the_content() contains unexpected hard coded string replacement
--------------------------+-----------------------------
 Reporter:  awelzel       |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Formatting    |    Version:  3.8.1
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In wp-includes/post-template.php the function the_content() has an
 unexpected string replacemenet:

 {{{
 function the_content( $more_link_text = null, $strip_teaser = false) {
         $content = get_the_content( $more_link_text, $strip_teaser );
         $content = apply_filters( 'the_content', $content );
         $content = str_replace( ']]>', ']]>', $content );
         echo $content;
 }
 }}}

 This makes no sense at all and breaks CDATA blocks. Why?

 Suggested solution: Remove the line

 {{{
         $content = str_replace( ']]>', ']]>', $content );
 }}}

 and implement a filter to do this replacement where neccessary.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27134>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list