#38187 closed defect (bug) (fixed)
Regex special chars should be escaped in WP_oEmbed
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.7 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Embeds | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
Just noticed four oembed regexes which each contained a non-escaped dot which potentially could result in incorrect matches (not very likely).
.
in a regex means "match anything", it needs to be escaped \.
to be interpreted as a literal period character.
So, for example, http://daiwly/
would match when it shouldn't. Though as I said, very unlikely as that would not make for a valid url.
These are probably artifacts from when each of these were transformed from a non-regex key into a regex based key.
Attachments (3)
Change History (12)
#2
@
7 years ago
- Milestone changed from Awaiting Review to 4.7
- Owner set to SergeyBiryukov
- Status changed from new to reviewing
@
7 years ago
Remove copy/paste artifact - unused and unnecessary variable in the test data provider method.
#4
@
7 years ago
Thanks for merging.
And sorry but I just noticed there was still a copy/paste artifact in the test code. Uploaded a patch to remove it.
#5
follow-up:
↓ 6
@
7 years ago
@SergeyBiryukov Just checking - did you see my last response & patch ?
#6
in reply to:
↑ 5
@
7 years ago
Replying to jrf:
@SergeyBiryukov Just checking - did you see my last response & patch ?
Seeing it now, thanks! It's OK to reopen the ticket if there are any additional fixes to make sure they don't get missed :)
#8
follow-up:
↓ 9
@
7 years ago
@SergeyBiryukov Thanks!
The reopen status has this ominous The resolution will be deleted note next to it which sounds as if any commits made for the ticket would be automatically reverted, so I was a bit wary about using it. Hmm.. maybe a ticket should be opened in meta about clarifying the message ?
#9
in reply to:
↑ 8
@
7 years ago
Replying to jrf:
The reopen status has this ominous The resolution will be deleted note next to it which sounds as if any commits made for the ticket would be automatically reverted, so I was a bit wary about using it. Hmm.. maybe a ticket should be opened in meta about clarifying the message ?
Good point, never thought about that. Yeah, feel free to create a meta ticket.
Adjust the related unit test provider array + add unit tests for the issue