[wp-trac] [WordPress Trac] #32661: oEmbed: Twitter URL pattern with query string breaks oEmbed

WordPress Trac noreply at wordpress.org
Tue Jun 16 15:10:30 UTC 2015

#32661: oEmbed: Twitter URL pattern with query string breaks oEmbed
 Reporter:  davisshaver         |      Owner:
     Type:  enhancement         |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Embeds              |    Version:  trunk
 Severity:  normal              |   Keywords:
  Focuses:  ui, administration  |
 When query strings that may have been appended to a tweet are URL encoded,
 the resulting extra characters in the URL parameter cause the oEmbed call
 to fail.

 This wp shell output is a good demonstration of the problem.

 wp> wp_oembed_get('https://twitter.com/mkramer/status/610467064000581633')
 string(339) "<blockquote class="twitter-tweet" width="474"><p lang="en"
 dir="ltr">Just found out about another digital NPR person
 leaving.</p>— Melody Joy Kramer (@mkramer) <a
 href="https://twitter.com/mkramer/status/610467064000581633">June 15,
 2015</a></blockquote><script async src="//platform.twitter.com/widgets.js"

 The expected user behavior of that second URL would be that it too
 transforms into the embedded tweet.

 The addition of a `oembed_fetch_url_pre` at the beginning of the `fetch()`
 function would allow us to filter the URL before it is encoded and
 appended to the provider URL. This filter would prevent us from having to
 manually recreate the oEmbed/provider URL in `oembed_fetch_url`.

Ticket URL: <https://core.trac.wordpress.org/ticket/32661>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list