diff --git a/src/wp-includes/default-filters.php b/src/wp-includes/default-filters.php index 70a9791ebc..75a171b4b0 100644 --- a/src/wp-includes/default-filters.php +++ b/src/wp-includes/default-filters.php @@ -165,6 +165,7 @@ add_filter( 'the_title_rss', 'ent2ncr', 8 ); add_filter( 'the_title_rss', 'esc_html' ); add_filter( 'the_content_rss', 'ent2ncr', 8 ); add_filter( 'the_content_feed', 'wp_staticize_emoji' ); +add_filter( 'the_content_feed', '_oembed_filter_feed_content' ); add_filter( 'the_excerpt_rss', 'convert_chars' ); add_filter( 'the_excerpt_rss', 'ent2ncr', 8 ); add_filter( 'comment_author_rss', 'ent2ncr', 8 ); diff --git a/src/wp-includes/embed-functions.php b/src/wp-includes/embed-functions.php index 585b78e855..360399e208 100644 --- a/src/wp-includes/embed-functions.php +++ b/src/wp-includes/embed-functions.php @@ -461,7 +461,9 @@ function get_post_embed_html( $post = null, $width, $height ) { $embed_url = get_post_embed_url( $post ); - $output = " 1000 ) { height = 1000; } else if ( height < 200 ) { @@ -32,7 +40,9 @@ /* Link to a specific URL on request. */ if ( 'link' === data.message ) { - var sourceURL = document.createElement( 'a' ), targetURL = document.createElement( 'a' ); + sourceURL = document.createElement( 'a' ); + targetURL = document.createElement( 'a' ); + sourceURL.href = source.getAttribute( 'src' ); targetURL.href = data.value; @@ -48,13 +58,14 @@ function onLoad() { var isIE10 = -1 !== navigator.appVersion.indexOf( 'MSIE 10' ), - isIE11 = !!navigator.userAgent.match( /Trident.*rv\:11\./ ); + isIE11 = !!navigator.userAgent.match( /Trident.*rv\:11\./ ), + iframes, iframeClone, i; /* Remove security attribute from iframes in IE10 and IE11. */ if ( isIE10 || isIE11 ) { - var iframes = document.querySelectorAll( '.wp-embedded-content[security]' ), iframeClone; + iframes = document.querySelectorAll( '.wp-embedded-content[security]' ); - for ( var i = 0; i < iframes.length; i++ ) { + for ( i = 0; i < iframes.length; i++ ) { iframeClone = iframes[ i ].cloneNode( true ); iframeClone.removeAttribute( 'security' ); iframes[ i ].parentNode.insertBefore( iframeClone, iframes[ i ].nextSibling ); diff --git a/tests/phpunit/tests/oembed/filterResult.php b/tests/phpunit/tests/oembed/filterResult.php index cfe5c98e3e..7559f620b6 100644 --- a/tests/phpunit/tests/oembed/filterResult.php +++ b/tests/phpunit/tests/oembed/filterResult.php @@ -78,4 +78,18 @@ EOD; $this->assertFalse( wp_filter_oembed_result( false, (object) array( 'type' => 'rich' ), '' ) ); $this->assertFalse( wp_filter_oembed_result( '', (object) array( 'type' => 'rich' ), '' ) ); } + + function test_filter_oembed_result_blockquote_adds_style_to_iframe() { + $html = '
'; + $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' ); + + $this->assertEquals( '', $actual ); + } + + function test_filter_oembed_result_allowed_html() { + $html = ''; + $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' ); + + $this->assertEquals( '
', $actual ); + } }