diff --git a/wp-includes/embed-functions.php b/wp-includes/embed-functions.php index 549ff9545c..739f0270e2 100644 --- a/wp-includes/embed-functions.php +++ b/wp-includes/embed-functions.php @@ -478,7 +478,7 @@ function get_post_embed_html( $width, $height, $post = null ) { * and edit wp-embed.js directly. */ $output .=<<1e3?g=1e3:200>~~g&&(g=200),f.height=g),"link"===d.message&&(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host&&b.activeElement===f&&(a.top.location.href=d.value))}},d&&(a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)))}(window,document); + !function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content"),j=b.querySelectorAll("blockquote.wp-embedded-content");for(c=0;c1e3)g=1e3;else if(200>~~g)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document); JS; } $output .= "\n//-->"; diff --git a/wp-includes/js/wp-embed.js b/wp-includes/js/wp-embed.js index 8223102381..50471c714b 100644 --- a/wp-includes/js/wp-embed.js +++ b/wp-includes/js/wp-embed.js @@ -1,9 +1,15 @@ (function ( window, document ) { 'use strict'; - var supportedBrowser = ( document.querySelector && window.addEventListener ), + var supportedBrowser = false, loaded = false; + if ( document.querySelector ) { + if ( window.addEventListener ) { + supportedBrowser = true; + } + } + window.wp = window.wp || {}; if ( !! window.wp.receiveEmbedMessage ) { @@ -50,8 +56,10 @@ targetURL.href = data.value; /* Only continue if link hostname matches iframe's hostname. */ - if ( targetURL.host === sourceURL.host && document.activeElement === source ) { - window.top.location.href = data.value; + if ( targetURL.host === sourceURL.host ) { + if ( document.activeElement === source ) { + window.top.location.href = data.value; + } } } } @@ -77,15 +85,17 @@ source = iframes[ i ]; source.style.display = ''; - 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 ); + if ( source.getAttribute( 'data-secret' ) ) { + continue; } + /* 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 ) && !!source.getAttribute( 'security' ) ) { + if ( ( isIE10 || isIE11 ) ) { iframeClone = source.cloneNode( true ); iframeClone.removeAttribute( 'security' ); source.parentNode.replaceChild( iframeClone, source ); diff --git a/wp-includes/js/wp-embed.min.js b/wp-includes/js/wp-embed.min.js index d249f41d8a..aed371f911 100644 --- a/wp-includes/js/wp-embed.min.js +++ b/wp-includes/js/wp-embed.min.js @@ -1 +1 @@ -!function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content"),j=b.querySelectorAll("blockquote.wp-embedded-content");for(c=0;c1e3?g=1e3:200>~~g&&(g=200),f.height=g),"link"===d.message&&(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host&&b.activeElement===f&&(a.top.location.href=d.value))}},d&&(a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)))}(window,document); \ No newline at end of file +!function(a,b){"use strict";function c(){if(!e){e=!0;var a,c,d,f,g=-1!==navigator.appVersion.indexOf("MSIE 10"),h=!!navigator.userAgent.match(/Trident.*rv:11\./),i=b.querySelectorAll("iframe.wp-embedded-content"),j=b.querySelectorAll("blockquote.wp-embedded-content");for(c=0;c1e3)g=1e3;else if(200>~~g)g=200;f.height=g}if("link"===d.message)if(h=b.createElement("a"),i=b.createElement("a"),h.href=f.getAttribute("src"),i.href=d.value,i.host===h.host)if(b.activeElement===f)a.top.location.href=d.value}}},d)a.addEventListener("message",a.wp.receiveEmbedMessage,!1),b.addEventListener("DOMContentLoaded",c,!1),a.addEventListener("load",c,!1)}(window,document); \ No newline at end of file diff --git a/wp-includes/version.php b/wp-includes/version.php index 6ee51f97da..8731c4fe08 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-beta4-35707'; +$wp_version = '4.4-beta4-35708'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.