Make WordPress Core

Opened 4 years ago

Last modified 4 years ago

#49683 new defect (bug)

Multisite oEmbeds of URLs ignore query parameters

Reported by: dd32's profile dd32 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Embeds Keywords:
Focuses: Cc:

Description

When running as a Multisite, WordPress oEmbed will embed links to other network sites without making a HTTP request, it does this by switching to the blog looking up by domain/path.

Unfortunately, it seems that it only operates on the path component and ignores the query component, and as a result, will embed https://other.network.site/?s=test as https://other.network.site/ changing the meaning of the embed.

A real example is that https://developer.wordpress.org/?s=get_cat will not embed anywhere, except on the WordPress.org network (For example, in a support request) where it ends up as an embed for https://developer.wordpress.org/.

This was originally reported as #meta3916

Change History (2)

#1 @dd32
4 years ago

It appears that this probably also requires that the front page of the embedded site be a static page, as then url_to_postid() will resolve it to a non-0 post ID.

#2 @dd32
4 years ago

I guess this a bug in url_to_postid() instead then, as it deliberately ignores query args unless it's a Post ID in p, page_id, or attachment_id.

url_to_postid( home_url( '?s=search_Term' ) )

should not return truthy.

Perhaps that method could simply only strip non-WordPress-registered query vars.

Note: See TracTickets for help on using tickets.