Embeds: URL encode YouTube video IDs for broader compatibility.

Merge of [40160] to the 4.5 branch.

Built from https://develop.svn.wordpress.org/branches/4.5@40163


git-svn-id: http://core.svn.wordpress.org/branches/4.5@40102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2017-03-06 12:06:05 +00:00
parent d3d39735ce
commit 4c805032cb
1 changed files with 1 additions and 1 deletions

View File

@ -251,7 +251,7 @@ function wp_embed_handler_googlevideo( $matches, $attr, $url, $rawattr ) {
*/
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] ) ) );
/**
* Filter the YoutTube embed output.