mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 15:31:42 +01:00
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. Built from https://develop.svn.wordpress.org/trunk@28594 git-svn-id: http://core.svn.wordpress.org/trunk@28419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cb68638968
commit
987e9905ac
@ -677,6 +677,9 @@ window.wp = window.wp || {};
|
||||
} );
|
||||
wp.mce.views.register( 'playlist', wp.mce.playlist );
|
||||
|
||||
/**
|
||||
* TinyMCE handler for the embed shortcode
|
||||
*/
|
||||
wp.mce.embed = {
|
||||
shortcode: 'embed',
|
||||
toView: wp.mce.gallery.toView,
|
||||
@ -716,19 +719,8 @@ window.wp = window.wp || {};
|
||||
} ).done( this.setHtml );
|
||||
},
|
||||
setHtml: function ( content ) {
|
||||
var scripts = $( content ).find( 'script' );
|
||||
|
||||
this.parsed = content;
|
||||
|
||||
$( this.node ).html( this.getHtml() );
|
||||
if ( scripts ) {
|
||||
_.each( scripts, function (script) {
|
||||
var element = document.createElement( 'script' );
|
||||
element.type = 'text/javascript';
|
||||
element.src = script.src;
|
||||
tinymce.activeEditor.contentDocument.getElementsByTagName( 'head' )[0].appendChild( element );
|
||||
} );
|
||||
}
|
||||
this.parseMediaShortcodes();
|
||||
},
|
||||
parseMediaShortcodes: function () {
|
||||
|
2
wp-includes/js/mce-view.min.js
vendored
2
wp-includes/js/mce-view.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user