You appear to be a bot. Output may be restricted
Description
Usage
Tests_Filter_oEmbed_Result::test_filter_oembed_result_with_untrusted_provider();
Parameters
Returns
void
Source
File name: wordpress-develop-tests/phpunit/tests/oembed/filterResult.php
Lines:
1 to 12 of 12
public function test_filter_oembed_result_with_untrusted_provider() { $html = '<p></p><iframe onload="alert(1)" src="http://example.com/sample-page/"></iframe>'; $actual = wp_filter_oembed_result( $html, (object) array( 'type' => 'rich' ), 'http://example.com/sample-page/' ); $matches = array(); preg_match( '|src=".*#\?secret=([\w\d]+)" data-secret="([\w\d]+)"|', $actual, $matches ); $this->assertArrayHasKey( 1, $matches ); $this->assertArrayHasKey( 2, $matches ); $this->assertSame( $matches[1], $matches[2] ); }