Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#37751 closed defect (bug) (fixed)

Incorrect $format passed to the oembed_endpoint_url filter

Reported by: swissspidy's profile swissspidy Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.7 Priority: normal
Severity: normal Version: 4.4
Component: Embeds Keywords: good-first-bug has-patch
Focuses: docs Cc:


In get_oembed_endpoint_url(). $format is set to false when JSON is passed as the format.

This is done so that the JSON format (which is the default) isn't unnecessarily appended to the URL.

However, when using the oembed_endpoint_url filter, $format is always false in that case. The filter docs state a string is passed, so this is unexpected behaviour.

The add_query_arg() part should be changed to read something like format' => ( 'json' === $format ) ? false : $format,

Attachments (1)

37751.diff (487 bytes) - added by danhgilmore 8 years ago.
Patch to check if format is JSON in add_query_arg()

Download all attachments as: .zip

Change History (3)

8 years ago

Patch to check if format is JSON in add_query_arg()

#1 @danhgilmore
8 years ago

  • Keywords has-patch added; needs-patch removed

#2 @SergeyBiryukov
8 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 38321:

Embeds: In get_oembed_endpoint_url(), avoid inadvertent stomping of the $format parameter passed to oembed_endpoint_url filter.

Props danhgilmore.
Fixes #37751.

Note: See TracTickets for help on using tickets.