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.

git-svn-id: https://develop.svn.wordpress.org/trunk@39347 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Pascal Birchler 2016-11-23 13:37:12 +00:00
parent f3a59f8632
commit ab087e8593
1 changed files with 5 additions and 7 deletions

View File

@ -97,15 +97,13 @@
for ( i = 0; i < iframes.length; i++ ) {
source = iframes[ i ];
if ( source.getAttribute( 'data-secret' ) ) {
continue;
if ( ! source.getAttribute( 'data-secret' ) ) {
/* Add secret to iframe */
secret = Math.random().toString( 36 ).substr( 2, 10 );
source.src += '#?secret=' + secret;
source.setAttribute( 'data-secret', secret );
}
/* Add secret to iframe */
secret = Math.random().toString( 36 ).substr( 2, 10 );
source.src += '#?secret=' + secret;
source.setAttribute( 'data-secret', secret );
/* Remove security attribute from iframes in IE10 and IE11. */
if ( ( isIE10 || isIE11 ) ) {
iframeClone = source.cloneNode( true );