Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#11980 closed defect (bug) (fixed)

oembed not respecting Media -> Maximum embed size -> height

Reported by: philipsoutham's profile philipsoutham Owned by: viper007bond's profile Viper007Bond
Milestone: 3.0 Priority: normal
Severity: major Version: 2.9
Component: Embeds Keywords: has-patch commit
Focuses: Cc:

Description

When adding an oauth provider that is not in the current whitelist, via the following code in functions.php

add_action('init', 'movieclips_embeds');

function movieclips_embeds() {
    wp_oembed_add_provider( '#http://(www\.)?movieclips.com/watch/[\w]+/[\w]+/#i', 'http://movieclips.com/services/oembed/' , true);
}

The Maximum embed size "height" paramter (set in settings->media) seems to be ignored, sending a value of 700 to the provider unless explicitly set in the embed short tag. Please see attached screenshots for demonstration of bug to aid in my explanation.

Attachments (7)

media-settings.png (44.5 KB) - added by philipsoutham 15 years ago.
Showing that width is set to 560, height set to 304 in settings->media
post-content.png (47.7 KB) - added by philipsoutham 15 years ago.
Showing methods of embedding media, without short tag, with short tag, and with short tag where width and height are explicitly set.
add_provider-fuction-call.png (8.9 KB) - added by philipsoutham 15 years ago.
Showing code to call function to add non-whitelisted oembed provider.
wp_embed_defaults-function.png (24.7 KB) - added by philipsoutham 15 years ago.
Shows where height is statically set to 700 in wp-includes/media.php -> wp_embed_defaults function
calls-made-to-oembed-provider.png (10.9 KB) - added by philipsoutham 15 years ago.
Showing movieclips oembed provider log where maxheight parameter is set to 700 for all requests except for the one where height is explicitly set in embed short tag.
oembed-post-result.jpg (194.2 KB) - added by philipsoutham 15 years ago.
Showing embedded media on page as a result of publishing methods shown in attachment "post-content.png"
11980.patch (664 bytes) - added by Viper007Bond 15 years ago.

Download all attachments as: .zip

Change History (14)

@philipsoutham
15 years ago

Showing that width is set to 560, height set to 304 in settings->media

@philipsoutham
15 years ago

Showing methods of embedding media, without short tag, with short tag, and with short tag where width and height are explicitly set.

@philipsoutham
15 years ago

Showing code to call function to add non-whitelisted oembed provider.

@philipsoutham
15 years ago

Shows where height is statically set to 700 in wp-includes/media.php -> wp_embed_defaults function

@philipsoutham
15 years ago

Showing movieclips oembed provider log where maxheight parameter is set to 700 for all requests except for the one where height is explicitly set in embed short tag.

@philipsoutham
15 years ago

Showing embedded media on page as a result of publishing methods shown in attachment "post-content.png"

#1 @philipsoutham
15 years ago

Correction to original ticket entry; "oauth" shoud be "oembed". Too many o* protocols...

#2 @ryan
15 years ago

  • Keywords Viper007Bond added

#3 @ryan
15 years ago

  • Keywords Viper007Bond removed
  • Owner set to Viper007Bond
  • Status changed from new to assigned

#4 @ryan
15 years ago

  • Component changed from Media to oEmbed

#5 @Viper007Bond
15 years ago

  • Keywords has-patch added

Hmm, how'd I manage that one?

@Viper007Bond
15 years ago

#6 @nacin
15 years ago

  • Keywords commit added
  • Milestone changed from Unassigned to 3.0
  • Version changed from 2.9.1 to 2.9

IMO, should be considered for the 2.9 branch to repair expected functionality.

Summing up from IRC: While width is the typical limiting factor, if the oembed provider does not follow an aspect ratio then it would be apparent. Plus, the only thing worse than a core option is an option in core that doesn't work.

#7 @ryan
15 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [12875]) Respect maximum embed height. Props Viper007Bond. fixes #11980

Note: See TracTickets for help on using tickets.