[wp-trac] [WordPress Trac] #48497: If preformatted block contains "<script>" tag page would not save

WordPress Trac noreply at wordpress.org
Tue Jan 21 20:07:11 UTC 2020


#48497: If preformatted block contains "<script>" tag page would not save
--------------------------+------------------------------
 Reporter:  martynasma    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  5.2.4
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by stidch):

 Sounds similar to the issue here:
 https://core.trac.wordpress.org/ticket/48268

 I don't know if the issue I face is exactly the same, but at least looks
 similar.

 I cannot save any page, which contain a shortcode, which contain a call to
 a java-script method

 For example:

 {{{
 onload="resizeIframe(this)"
 }}}

 In my case I try to resize an iframe with the advanced-iframe plugin. The
 full shortcode looks like this:

 {{{
 advanced_iframe src="https://xxx.com/script.php?parameter=value"
 frameborder="0" scrolling="no" onload="resizeIframe(this)"
 }}}


 In an html block above I'v defined the resizeIframe method.

 {{{
 <script>
 function resizeIframe(iframe) {
   iframe.height = "10px" // required for reducing the size
   iframe.height = iframe.contentWindow.document.body.scrollHeight + "px";
 }
 </script>
 }}}


 If I remove the part

 {{{
 onload="resizeIframe(this)
 }}}

 from the shortcode I can successfully save the page. With I can't.

 I've tried already with disabled plugins and default theme.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48497#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list