diff --git a/wp-includes/embed.php b/wp-includes/embed.php index 010ae7b7e5..05f0114c9b 100644 --- a/wp-includes/embed.php +++ b/wp-includes/embed.php @@ -753,24 +753,30 @@ function wp_filter_oembed_result( $result, $data, $url ) { } $html = $content[1] . $content[2]; + preg_match( '/ src=([\'"])(.*?)\1/', $html, $results ); + + if ( ! empty( $results ) ) { + $secret = wp_generate_password( 10, false ); + + $url = esc_url( "{$results[2]}#?secret=$secret" ); + $q = $results[1]; + + $html = str_replace( $results[0], ' src=' . $q . $url . $q . ' data-secret=' . $q . $secret . $q, $html ); + $html = str_replace( '