[wp-trac] [WordPress Trac] #33106: Automatic removal of new lines in CDATA blocks may break content with unfiltered_html

WordPress Trac noreply at wordpress.org
Fri Jul 24 00:34:06 UTC 2015


#33106: Automatic removal of new lines in CDATA blocks may break content with
unfiltered_html
--------------------------+-----------------------------
 Reporter:  jeremyfelt    |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.2.3
 Severity:  normal        |   Keywords:  needs-patch
  Focuses:                |
--------------------------+-----------------------------
 As of 4.2.3, depending on how a CDATA block is used, the stripping of new
 lines in this content may break when displayed on the front end, even when
 published with `unfiltered_html` capabilities.

 Intended content:
 {{{
 <script>// <![CDATA[
 _my_function('data');
 // ]]>
 </script>
 }}}

 In 4.2.2, this content is left as is and `_my_function()` fires as
 expected. In 4.2.3, the content is manipulated as such:

 {{{
 <script>// <![CDATA[ _my_function('data'); // ]]></script>
 }}}

 This results in the script being commented out by the `//` and it will not
 fire.

 A workaround for this is to use `/*` for commenting.

 {{{
 <script> /* <![CDATA[ */ _my_function('data'); /* ]]> */ </script>
 }}}

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


More information about the wp-trac mailing list