Make WordPress Core

Changeset 29202


Ignore:
Timestamp:
07/17/2014 12:49:11 AM (12 years ago)
Author:
azaozz
Message:

TinyMCE wpView: prevent fatal (security) errors when trying to access iframe.contentWindow in pausePlayers() and unsetPlayers(). See #28905.

File:
1 edited

Legend:

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

    r29198 r29202  
    133133                                                allowTransparency: 'true',
    134134                                                scrolling: 'no',
     135                                                'class': 'wpview-sandbox',
    135136                                                style: {
    136137                                                        width: '100%',
    … …  
    555556                        pausePlayers: function() {
    556557                                this.getNodes( function( editor, node, content ) {
    557                                         var p, win = $( 'iframe', content ).get(0).contentWindow;
    558 
    559                                         if ( win && win.mejs ) {
     558                                        var p, win,
     559                                                iframe = $( 'iframe.wpview-sandbox', content ).get(0);
     560
     561                                        if ( iframe && ( win = iframe.contentWindow ) && win.mejs ) {
    560562                                                for ( p in win.mejs.players ) {
    561563                                                        win.mejs.players[p].pause();
    … …  
    567569                        unsetPlayers: function() {
    568570                                this.getNodes( function( editor, node, content ) {
    569                                         var p, win = $( 'iframe', content ).get(0).contentWindow;
    570 
    571                                         if ( win && win.mejs ) {
     571                                        var p, win,
     572                                                iframe = $( 'iframe.wpview-sandbox', content ).get(0);
     573
     574                                        if ( iframe && ( win = iframe.contentWindow ) && win.mejs ) {
    572575                                                for ( p in win.mejs.players ) {
    573576                                                        win.mejs.players[p].remove();
Note: See TracChangeset for help on using the changeset viewer.