Embeds: URL encode YouTube video IDs for broader compatibility.

Merge of [40160] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@40161


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2017-03-06 12:04:34 +00:00
parent a80351f7ed
commit 25e3338dbc
2 changed files with 2 additions and 2 deletions

View File

@ -226,7 +226,7 @@ function wp_maybe_load_embeds() {
*/ */
function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) { function wp_embed_handler_youtube( $matches, $attr, $url, $rawattr ) {
global $wp_embed; 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. * Filters the YoutTube embed output.

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.7.3-RC1-40149'; $wp_version = '4.7.3-RC1-40161';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.