Make WordPress Core

Changeset 39347


Ignore:
Timestamp:
11/23/2016 01:37:12 PM (8 years ago)
Author:
swissspidy
Message:

Embeds: Correctly remove security attribute from iframes in IE 10 and IE 11.

This was originally added in 4.4, but presumably broke with [35708], which prevented these browsers from actually reaching the relevant code section.
Let's make embeds work again in IE 10 and IE 11.

Fixes #38694.

File:
1 edited

Legend:

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

    r36708 r39347  
    9898            source = iframes[ i ];
    9999
    100             if ( source.getAttribute( 'data-secret' ) ) {
    101                 continue;
     100            if ( ! source.getAttribute( 'data-secret' ) ) {
     101                /* Add secret to iframe */
     102                secret = Math.random().toString( 36 ).substr( 2, 10 );
     103                source.src += '#?secret=' + secret;
     104                source.setAttribute( 'data-secret', secret );
    102105            }
    103 
    104             /* Add secret to iframe */
    105             secret = Math.random().toString( 36 ).substr( 2, 10 );
    106             source.src += '#?secret=' + secret;
    107             source.setAttribute( 'data-secret', secret );
    108106
    109107            /* Remove security attribute from iframes in IE10 and IE11. */
Note: See TracChangeset for help on using the changeset viewer.