Opened 10 years ago
Closed 10 years ago
#29427 closed defect (bug) (fixed)
Adjust oEmbed regex for Slideshare
Reported by: | Latz | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | Embeds | Keywords: | has-patch needs-testing |
Focuses: | Cc: |
Description
The current regex in class-oembed.php for slideshare assumes that the URL is "www.slideshare.net" or "slideshare.net".
Accessing slideshare from Germany I experienced that the URL is "de.slideshare.net". I assume there are others for various languages.
This patch changes
'#https?://(www\.)?slideshare\.net/.*#i'
to
'#https?://(.+\.)?slideshare\.net/.*#i'
so that these URLs permitted to be embedded.
Attachments (2)
Change History (11)
#1
@
10 years ago
- Summary changed from Adjust oEmbed reges for Slideshare to Adjust oEmbed regex for Slideshare
#3
in reply to:
↑ 2
@
10 years ago
I think that regex needs to be tightened up a little. It a cursory glance, it looks like it'll be greedy.
#https?://([a-z]+\.)?slideshare\.net/.*#i
will probably suffice.
Yeah, you're right, I tend to make regexes too greedy. I adjusted the patch.
This ticket was mentioned in IRC in #wordpress-dev by Latz. View the logs.
10 years ago
#7
@
10 years ago
.+?\.
would work for arbitrary subdomains, so that www3
and the like would work, will test for fun.
There is indeed a language switcher at the bottom of slideshare.net which changes the subdomain.
I think that regex needs to be tightened up a little. It a cursory glance, it looks like it'll be greedy.
#https?://([a-z]+\.)?slideshare\.net/.*#i
will probably suffice.