WordPress.org

Make WordPress Core

Changeset 28594


Ignore:
Timestamp:
05/27/14 19:59:47 (3 years ago)
Author:
wonderboymusic
Message:

When parsing an [embed] shortcode into a TinyMCE view, don't attempt to append any returned <script>s to the editor's <head>. This affects only a few supported endpoints: Issuu and Twitter.

See #28195.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/mce-view.js

    r28580 r28594  
    678678    wp.mce.views.register( 'playlist', wp.mce.playlist ); 
    679679 
     680    /** 
     681     * TinyMCE handler for the embed shortcode 
     682     */ 
    680683    wp.mce.embed = { 
    681684        shortcode: 'embed', 
     
    717720            }, 
    718721            setHtml: function ( content ) { 
    719                 var scripts = $( content ).find( 'script' ); 
    720  
    721722                this.parsed = content; 
    722  
    723723                $( this.node ).html( this.getHtml() ); 
    724                 if ( scripts ) { 
    725                     _.each( scripts, function (script) { 
    726                         var element = document.createElement( 'script' ); 
    727                         element.type = 'text/javascript'; 
    728                         element.src = script.src; 
    729                         tinymce.activeEditor.contentDocument.getElementsByTagName( 'head' )[0].appendChild( element ); 
    730                     } ); 
    731                 } 
    732724                this.parseMediaShortcodes(); 
    733725            }, 
Note: See TracChangeset for help on using the changeset viewer.