From ab087e8593e071551f73f4d8da2f87b701f4de8f Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 23 Nov 2016 13:37:12 +0000 Subject: [PATCH] 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 --- src/wp-includes/js/wp-embed.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/wp-includes/js/wp-embed.js b/src/wp-includes/js/wp-embed.js index 966a41f74a..3be0dc7245 100644 --- a/src/wp-includes/js/wp-embed.js +++ b/src/wp-includes/js/wp-embed.js @@ -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 );