Embeds: URL encode YouTube video IDs for broader compatibility.

git-svn-id: https://develop.svn.wordpress.org/trunk@40160 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2017-03-06 11:41:47 +00:00
parent e24a96c734
commit ccfe51c3b9
1 changed files with 1 additions and 1 deletions

View File

@ -226,7 +226,7 @@ function wp_maybe_load_embeds() {
*/
function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) {
global $wp_embed;
$embed = $wp_embed->autoembed( "https://youtube.com/watch?v={$matches[2]}" );
$embed = $wp_embed->autoembed( sprintf( "https://youtube.com/watch?v=%s", urlencode( $matches[2] ) ) );
/**
* Filters the YoutTube embed output.