Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#27134 closed defect (bug) (duplicate)

the_content() contains unexpected hard coded string replacement

Reported by: awelzel's profile awelzel Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8.1
Component: Formatting Keywords:
Focuses: Cc:


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.

Change History (1)

#1 @SergeyBiryukov
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #3670.

Note: See TracTickets for help on using tickets.