Skip to content

Instantly share code, notes, and snippets.

@champierre
Created August 31, 2011 16:57
Show Gist options
  • Select an option

  • Save champierre/1184054 to your computer and use it in GitHub Desktop.

Select an option

Save champierre/1184054 to your computer and use it in GitHub Desktop.
121 function wxr_cdata( $str ) {
122 if ( seems_utf8( $str ) == false )
123 $str = utf8_encode( $str );
124
125 // $str = ent2ncr(esc_html($str));
126 $str = str_replace(']]>', ']]]]><![CDATA[>', $str); // <= Add This
127 $str = "<![CDATA[$str" . ( ( substr( $str, -1 ) == ']' ) ? ' ' : '' ) . ']]>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment