diff --git a/wp-includes/embed.php b/wp-includes/embed.php index b987649f52..fcc61a947f 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( '