From c57ce00691c7cbb1009285b4e601f1312ba9b2a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helen=20Hou-Sand=C3=AD?= Date: Mon, 9 Nov 2020 20:28:07 +0000 Subject: [PATCH] Feeds: Don't treat media URLs with fragments as unique for enclosures. Props archduck, dshanske. Fixes #47421. Built from https://develop.svn.wordpress.org/trunk@49552 git-svn-id: http://core.svn.wordpress.org/trunk@49290 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 2 ++ wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index b594c1de77..08bae745bd 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -899,6 +899,8 @@ function do_enclose( $content, $post ) { $post_links = apply_filters( 'enclosure_links', $post_links, $post->ID ); foreach ( (array) $post_links as $url ) { + $url = strip_fragment_from_url( $url ); + if ( '' !== $url && ! $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post->ID, $wpdb->esc_like( $url ) . '%' ) ) ) { $headers = wp_get_http_headers( $url ); diff --git a/wp-includes/version.php b/wp-includes/version.php index d17929e5df..b11db95dd9 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-beta3-49551'; +$wp_version = '5.6-beta3-49552'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.