From ccfe51c3b91dadfae00c39deed24f62950ebbaf6 Mon Sep 17 00:00:00 2001 From: "Dominik Schilling (ocean90)" Date: Mon, 6 Mar 2017 11:41:47 +0000 Subject: [PATCH] Embeds: URL encode YouTube video IDs for broader compatibility. git-svn-id: https://develop.svn.wordpress.org/trunk@40160 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/embed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/embed.php b/src/wp-includes/embed.php index ac62f5ecfd..d961dc941b 100644 --- a/src/wp-includes/embed.php +++ b/src/wp-includes/embed.php @@ -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.