#54789 closed defect (bug) (reported-upstream)
oEmbeds: allow embedding Twitter Profiles with a trailing slash
Reported by: | jeherve | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Embeds | Keywords: | |
Focuses: | Cc: |
Description
This is a follow-up to #38003.
#### Steps to reproduce
- Go to Posts > Add New
- On a new line, paste a Twitter profile URL, without a trailing slash, such as
https://twitter.com/jeherve
- The URL will be transformed into an embed block (Twitter variation).
- Now, paste a Twitter profile URL with a trailing slash, e.g.
https://twitter.com/wordpress/
- 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?
Attachments (1)
Change History (4)
#1
@
3 years ago
It's still an issue. Twitter API doesn't like the trailing slash.
https://publish.twitter.com/oembed?url=https://twitter.com/TwitterDev/
Allow trailing slash in Twitter Profile embeds