[wp-trac] [WordPress Trac] #54789: oEmbeds: allow embedding Twitter Profiles with a trailing slash
WordPress Trac
noreply at wordpress.org
Tue Jan 11 09:39:32 UTC 2022
#54789: oEmbeds: allow embedding Twitter Profiles with a trailing slash
--------------------------+-----------------------------
Reporter: jeherve | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Embeds | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
This is a follow-up to #38003.
#### Steps to reproduce
1. Go to Posts > Add New
2. On a new line, paste a Twitter profile URL, without a trailing slash,
such as {{{https://twitter.com/jeherve}}}
3. The URL will be transformed into an embed block (Twitter variation).
4. Now, paste a Twitter profile URL with a trailing slash, e.g.
{{{https://twitter.com/wordpress/}}}
5. You'll notice that the embed fails for this URL.
This appears to be because we do not currently support trailing slashes
for profile URLs:
{{{'#https?://(www\.)?twitter\.com/\w{1,15}$#i' => array(
'https://publish.twitter.com/oembed', true ),}}}
-- https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp-
oembed.php#L68
It seems that this was done on purpose when those regexes were added:
> Turns out that Twitter's API doesn't like trailing slashes so I'm going
to remove the optional slash from the regex.
-- https://core.trac.wordpress.org/ticket/38003#comment:9
Would it be possible to add the trailing slash today, or is this still an
issue?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54789>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list