From 6411c0953c753e1a237724f0e9d509cec1a2f75b Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Mon, 9 Nov 2020 20:26:18 +0000 Subject: [PATCH] Feeds: Don't treat media URLs with fragments as unique for enclosures. Props archduck, dshanske. Fixes #47421. git-svn-id: https://develop.svn.wordpress.org/trunk@49552 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/functions.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index b594c1de77..08bae745bd 100644 --- a/src/wp-includes/functions.php +++ b/src/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 );