diff --git src/wp-includes/embed.php src/wp-includes/embed.php
index ff42351..8c79cc8 100644
|
|
function wp_filter_oembed_result( $result, $data, $url ) { |
777 | 777 | |
778 | 778 | if ( ! empty( $content[1] ) ) { |
779 | 779 | // We have a blockquote to fall back on. Hide the iframe by default. |
780 | | $html = str_replace( '<iframe', '<iframe style="display:none;"', $html ); |
| 780 | $html = str_replace( '<iframe', '<iframe style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"', $html ); |
781 | 781 | $html = str_replace( '<blockquote', '<blockquote class="wp-embedded-content"', $html ); |
782 | 782 | } |
783 | 783 | |
… |
… |
function print_embed_scripts() { |
953 | 953 | * @return string The filtered content. |
954 | 954 | */ |
955 | 955 | function _oembed_filter_feed_content( $content ) { |
956 | | return str_replace( '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="display:none;"', '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"', $content ); |
| 956 | return str_replace( '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"', '<iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"', $content ); |
957 | 957 | } |
958 | 958 | |
959 | 959 | /** |
diff --git src/wp-includes/js/wp-embed.js src/wp-includes/js/wp-embed.js
index 248ae2a..966a41f 100644
|
|
|
50 | 50 | continue; |
51 | 51 | } |
52 | 52 | |
53 | | source.style.display = ''; |
| 53 | source.removeAttribute( 'style' ); |
54 | 54 | |
55 | 55 | /* Resize the iframe on request. */ |
56 | 56 | if ( 'height' === data.message ) { |
diff --git tests/phpunit/tests/oembed/filterResult.php tests/phpunit/tests/oembed/filterResult.php
index 10dc43b..7f29d56 100644
|
|
EOD; |
83 | 83 | $html = '<blockquote></blockquote><iframe></iframe>'; |
84 | 84 | $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' ); |
85 | 85 | |
86 | | $this->assertEquals( '<blockquote class="wp-embedded-content"></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="display:none;"></iframe>', $actual ); |
| 86 | $this->assertEquals( '<blockquote class="wp-embedded-content"></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"></iframe>', $actual ); |
87 | 87 | } |
88 | 88 | |
89 | 89 | function test_filter_oembed_result_allowed_html() { |
90 | 90 | $html = '<blockquote class="foo" id="bar"><strong><a href="" target=""></a></strong></blockquote><iframe></iframe>'; |
91 | 91 | $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), '' ); |
92 | 92 | |
93 | | $this->assertEquals( '<blockquote class="wp-embedded-content"><a href=""></a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="display:none;"></iframe>', $actual ); |
| 93 | $this->assertEquals( '<blockquote class="wp-embedded-content"><a href=""></a></blockquote><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" style="position: absolute; clip: rect(1px, 1px, 1px, 1px);"></iframe>', $actual ); |
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |