Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 5 years ago

#32714 closed defect (bug) (fixed)

oEmbed of m.youtube.com links don't render

Reported by: undergroundnetwork's profile undergroundnetwork Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.3 Priority: normal
Severity: normal Version: 3.9
Component: Embeds Keywords: good-first-bug has-patch
Focuses: Cc:

Description

When a user is using a mobile phone to post to Wordpress, and they copy and paste a YouTube URL, YouTube changes the URLs of it's videos when accessed on a mobile phone by adding an m. before the URL, like: https://m.youtube.com/watch?v=yfUflij74P4

This results in Wordpress not recognizing that it is a YouTube URL and oEmbed does not render as a result.

This causes problems when using Press This as Press This grabs the URL which has an m. in it. This is a problem when a user has copied a YouTube URL on their phone (via the URL address bar, or the share menu on most phones) and they try to paste it into an article, because, again, YouTube puts that m. in the URL.

In order to make this work, perhaps a filter that removes the m. from YouTube URLs would help and the URLs could then render.

Attachments (2)

32714.patch (1.7 KB) - added by Toru 9 years ago.
Patch for oEmbed m.youtube.com
32714.tests.patch (915 bytes) - added by johnbillion 9 years ago.

Download all attachments as: .zip

Change History (27)

#1 @johnbillion
9 years ago

  • Keywords needs-patch needs-unit-tests good-first-bug added
  • Milestone changed from Awaiting Review to Future Release
  • Version changed from 4.2.2 to 3.9

#2 @johnbillion
9 years ago

  • Summary changed from oEmbed of YouTube links via mobile phones don't render. to oEmbed of m.youtube.com links don't render

#3 @johnbillion
9 years ago

Thanks for the report!

#4 @Toru
9 years ago

Interested to work on this bug. I will have a go.

@Toru
9 years ago

Patch for oEmbed m.youtube.com

#5 @Toru
9 years ago

I have attached a patch for wp-includes/class-oembed.php. It should now handle both www. and m..
I have found that code for PressThis in wp-admin/includes/class-wp-press-this.php already handles both www. and m. YouTube site.

#6 @johnbillion
9 years ago

  • Keywords has-patch added; needs-patch needs-unit-tests removed
  • Milestone changed from Future Release to 4.3

Thanks Toru. All looks good. 32714.tests.patch adds some tests.

#7 @wonderboymusic
9 years ago

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

In 32930:

YouTube oEmbed parsing: support the m subdomain.
Adds unit tests.

Props Toru, johnbillion.
Fixes #32714.

#8 @Toru
9 years ago

Thanks johnbillion, and wonderboymusic!
That was my first bug patch :-)

#9 follow-up: @undergroundnetwork
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

This fix seems to no longer work, the mobile YouTube links no longer rendering again. This link does not render for example:

https://m.youtube.com/watch?feature=youtu.be&v=peVH0k0Hisc

Perhaps YouTube changed the format of their links?

Charles

Last edited 9 years ago by undergroundnetwork (previous) (diff)

#10 in reply to: ↑ 9 @ocean90
9 years ago

Replying to undergroundnetwork:

This fix seems to no longer work, the mobile YouTube links no longer rendering again. This link does not render for example:

https://m.youtube.com/watch?feature=youtu.be&v=peVH0k0Hisc

Which version are you testing? Your link seems to work for me:

var_dump( esc_html( wp_oembed_get( 'https://m.youtube.com/watch?feature=youtu.be&v=peVH0k0Hisc' ) ) );
// string(189) "<iframe width="660" height="371" src="https://www.youtube.com/embed/peVH0k0Hisc?feature=oembed" frameborder="0" allowfullscreen></iframe>"

#11 @undergroundnetwork
9 years ago

I'm running 4.2.4, the first test was on an iPad using Press This.

Oh wait! Is this not supposed to work until 4.3?? Did I just screw up?

If it is supposed to work, here is another example, I just took this YouTube link:

https://m.youtube.com/watch?feature=youtu.be&v=CDsNZJTWw0w

Pasted it into my new post and again it doesn't render.

I just ran it on a clean site, twenty12 theme, no plugins, but this link will render:

https://youtube.com/watch?feature=youtu.be&v=CDsNZJTWw0w

Again, if this is not supposed to work until 4.3 I apologize for reopening this again.

#12 @knutsp
9 years ago

  • Keywords close added

This ticket has milestone 4.3

#13 @helen
9 years ago

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

#14 @netweb
9 years ago

  • Keywords close removed

#15 @johnbillion
7 years ago

In 41712:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

See #42076, #32714, #23149

#16 @SergeyBiryukov
5 years ago

In 47479:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.8 branch.
See #42076, #32714, #23149.

#17 @SergeyBiryukov
5 years ago

In 47480:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.7 branch.
See #42076, #32714, #23149.

#18 @SergeyBiryukov
5 years ago

In 47481:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.6 branch.
See #42076, #32714, #23149.

#19 @SergeyBiryukov
5 years ago

In 47482:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.5 branch.
See #42076, #32714, #23149.

#20 @SergeyBiryukov
5 years ago

In 47483:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.4 branch.
See #42076, #32714, #23149.

#21 @SergeyBiryukov
5 years ago

In 47484:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.3 branch.
See #42076, #32714, #23149.

#22 @SergeyBiryukov
5 years ago

In 47485:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.2 branch.
See #42076, #32714, #23149.

#23 @SergeyBiryukov
5 years ago

In 47486:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.1 branch.
See #42076, #32714, #23149.

#24 @SergeyBiryukov
5 years ago

In 47487:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 4.0 branch.
See #42076, #32714, #23149.

#25 @SergeyBiryukov
5 years ago

In 47488:

Embeds: Remove the external oEmbed tests for YouTube.

These tests no longer test anything that WordPress core has control over. YouTube now serves everything
over HTTPS by default, so the tests for #23149 will always pass, and the tests for #32714 aren't testing
anything that core has control over.

Tests for the responses from oEmbed providers has been attempted and reverted in #32360.

Props johnbillion.
Merges [41712] to the 3.9 branch.
See #42076, #32714, #23149.

Note: See TracTickets for help on using tickets.