#31212 closed defect (bug) (fixed)
oEmbed discovery fails on XHTML head links
| Reported by: | cweiske | Owned by: | wonderboymusic |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.2 |
| Component: | Embeds | Version: | 4.1 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
In XHTML, link tags in the HTML head need to be closed:
<link title="test" href="http://example.org/test"/>
Wordpress' oEmbed discovery in WP_oEmbed::discover() fails on this.
It extracts the attributes ( title="test" href="http://example.org/test"/) and sends it through shortcode_parse_atts. The trailing slash is included even though it's not part of the attributes.
Either discover()'s link tag should not match the slash, or shortcode_parse_atts should be changed to cope with it.
Attachments (1)
Change History (4)
#3
@
11 years ago
In general, I'd argue that /U (PCRE_UNGREEDY) should not be used. It isn't natural to read a regular expression as if things are un-greedy; using ? to make something lazy/reluctant/nongreedy is going to be easier to understand.
/U is also sometimes misread as /u which is for UTF-8 (and also should not be used in many cases).
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Patch that fixes the problem.