[wp-trac] [WordPress Trac] #40658: Customize: Do fallback full page refresh when selective refresh partial content contains script

WordPress Trac noreply at wordpress.org
Tue May 16 23:42:03 UTC 2017


#40658: Customize: Do fallback full page refresh when selective refresh partial
content contains script
--------------------------+--------------------------
 Reporter:  westonruter   |       Owner:  westonruter
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  4.8
Component:  Customize     |     Version:  4.5
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+--------------------------

Comment (by westonruter):

 Actually, jQuery does evaluate inline `script` tags that get inserted into
 the DOM. For example, pasting the following into the HTML for a Text
 widget:

 {{{
 <iframe width='560' height='314'
 src='https://videopress.com/embed/OAVHZIvv?hd=0' frameborder='0'
 allowfullscreen></iframe><script src='https://v0.wordpress.com/js/next
 /videopress-iframe.js?m=1435166243'></script>
 <div id="currentTime">Loading...</div>
 <script>document.getElementById('currentTime').innerHTML='Current Time: '
 + String( new Date() );</script>
 }}}

 So really the main problem is `document.write()`. Currently an attempted
 `document.write()` is throwing an error. But this was the wrong move. What
 we should instead be doing is issuing a fallback refresh (of course):
 [attachment:40658.1.diff]

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


More information about the wp-trac mailing list