From b126a0144f826f1ff9b28817115579c708a5eb73 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 16 Jun 2015 00:35:25 +0000 Subject: [PATCH] In the `youtube_embed_url` embed handler, make `embed` a non-capturing group that alternately matches for `v` - YouTube supports both URL paths. Add unit test cases. Props dmchale for some patch work. Fixes #32161. Built from https://develop.svn.wordpress.org/trunk@32787 git-svn-id: http://core.svn.wordpress.org/trunk@32758 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/media.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index 4007fec7b9..57037710b0 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -2312,7 +2312,7 @@ function wp_maybe_load_embeds() { return; } - wp_embed_register_handler( 'youtube_embed_url', '#https?://(www.)?youtube\.com/embed/([^/]+)#i', 'wp_embed_handler_youtube' ); + wp_embed_register_handler( 'youtube_embed_url', '#https?://(www.)?youtube\.com/(?:v|embed)/([^/]+)#i', 'wp_embed_handler_youtube' ); wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index ede5824154..7f31dbc6ff 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32786'; +$wp_version = '4.3-alpha-32787'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.