WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#29857 closed defect (bug) (duplicate)

Instagram oEmbeds with Emoji only content break embeds

Reported by: Ipstenu Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Embeds Keywords:
Focuses: Cc:

Description

This is not actually WordPress but I'm not sure how we would go about telling Instagram their embed is broken.

Reproduce:

Insert an Instagram link that has emojii like http://instagram.com/p/tnZ6DfBjly/

This generates the following invalid HTML:

<p><a href="http://instagram.com/p/tnZ6DfBjly/"><img src="”http://scontent-a-lax.cdninstagram.com/hphotos-xaf1/t51.2885-15/10683883_355903761240624_2147231606_a.jpg”" alt="”</p">
	</a></p>

Clearly they're not sanitizing something right. I filed a bug report with Instagram (linking them back to this) and it's pretty obvious this isn't us. We're just calling their code, right? Maybe we can use wordpress.org power to push this like we did with TED?

Change History (2)

#1 @SergeyBiryukov
6 years ago

  • Summary changed from Instagram oEmbeds with Emoji only conent break embeds to Instagram oEmbeds with Emoji only content break embeds

#2 @SergeyBiryukov
6 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

There's nothing wrong with the code returned by Instagram:

{"provider_url":"http:\/\/instagram.com\/","media_id":"821739397652560242_201355397","title":"\ud83d\udc40\ud83d\udc40\ud83d\udc40","url":"http:\/\/photos-a.ak.instagram.com\/hphotos-ak-xaf1\/10683883_355903761240624_2147231606_n.jpg","author_name":"snookinic","height":640,"width":640,"version":"1.0","author_url":"http:\/\/instagram.com\/snookinic","author_id":201355397,"type":"photo","provider_name":"Instagram"}

The issue is that the output stops at the alt attribute, leaving an unclosed quote:

<a href="http://instagram.com/p/tnZ6DfBjly/"><img src="http://photos-a.ak.instagram.com/hphotos-ak-xaf1/10683883_355903761240624_2147231606_a.jpg" alt="

And the end result gets mangled by wptexturize():

<a href="http://instagram.com/p/tnZ6DfBjly/"><img src=&#187;http://photos-a.ak.instagram.com/hphotos-ak-xaf1/10683883_355903761240624_2147231606_a.jpg&#187; alt=&#187;

It's the same issue as in #27961. The workaround suggested there works here too.

Closing as a duplicate of #21212, for the same reason as in #27961.

Note: See TracTickets for help on using tickets.