Ticket #1464 (closed defect (bug): fixed)
wp-atom.php produces invalid enclosure
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.2 |
| Component: | General | Version: | 2.1 |
| Severity: | normal | Keywords: | has-patch commit |
| Cc: | dougal |
Description
In wp-atom.php there is a call to rss_enclosure, so when an enclosure is added to a post, it outputs an enclosure element, which is invalid accoring to feedvalidator.org
Possible fix: A function like atom_enclosure could be added that would output either something like this: <content type="audio/mpeg" src=" http://foo.com/foo.mp3" /> or this: <link rel="related" type="audio/mpeg" href=" http://foo.com/foo.mp3" /> instead of RSS 2.0's enclosure element.
Attachments
Change History
- Keywords needs-patch added; atom enclosures podcasting videoblogging removed
- Owner changed from anonymous to rob1n
- Version changed from 1.5.1.2 to 2.1
- Status changed from new to assigned
- Milestone set to 2.2
2.2 currently still calls rss_enclosure() for the Atom enclosure.
http://atomenabled.org/developers/syndication/#link
<link rel="enclosure">. Working on patch.
- Summary changed from wp-atom.php produces invalid output to wp-atom.php produces invalid enclosure
- Keywords has-patch added; needs-patch removed
Patch added that includes a new function (atom_enclosure), and replaces the call to rss_enclosure() in wp-atom.php with atom_enclosure().
Is the if ( is_array($val) ) really necessary, since you cast to an array in the foreach?
Also, it's missing a closing curly brace at the end.
Other than that, and the fact that we've moved the feed generation code under wp-includes recently, it appears to be fine.
- Keywords has-patch removed
Heh, I just copied the code from rss_enclosure() and made it Atom-specific. I'll make a new patch.
comment:10
rob1n — 5 years ago
- Keywords has-patch commit added
Okay, new patch is (hopefully) final. I also took the liberty of rewriting rss_enclosure(), as that code made no sense whatsoever.
comment:11
ryan — 5 years ago
- Status changed from assigned to closed
- Resolution set to fixed


There may not be a good solution for Atom 0.3, meaning aggregator support for enclosures in Atom 0.3 is not a standard feature. While support in aggregators may not be standard, this could be used: <link rel="related" type="audio/mpeg" href=" http://foo.com/foo.mp3" /> as it does validate, which is probably better than not validating.