Make WordPress Core

Opened 20 years ago

Closed 18 years ago

#1464 closed defect (bug) (fixed)

wp-atom.php produces invalid enclosure

Reported by: raster's profile raster Owned by: rob1n's profile rob1n
Milestone: 2.2 Priority: normal
Severity: normal Version: 2.1
Component: General Keywords: has-patch commit
Focuses: Cc:

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 (2)

1464.diff (1.4 KB) - added by rob1n 18 years ago.
1464.2.diff (2.2 KB) - added by rob1n 18 years ago.

Download all attachments as: .zip

Change History (13)

#1 @raster
20 years ago

  • Keywords atom enclosures podcasting videoblogging added

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.

#2 @rob1n
18 years ago

  • Keywords needs-patch added; atom enclosures podcasting videoblogging removed
  • Milestone set to 2.2
  • Owner changed from anonymous to rob1n
  • Status changed from new to assigned
  • Version changed from 1.5.1.2 to 2.1

2.2 currently still calls rss_enclosure() for the Atom enclosure.

#3 @rob1n
18 years ago

http://atomenabled.org/developers/syndication/#link

<link rel="enclosure">. Working on patch.

#4 @rob1n
18 years ago

  • Summary changed from wp-atom.php produces invalid output to wp-atom.php produces invalid enclosure

@rob1n
18 years ago

#5 @rob1n
18 years ago

  • 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().

#6 @ryan
18 years ago

  • Cc dougal added

#7 @ryan
18 years ago

I'll ping dougal for his input.

#8 @dougal
18 years ago

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.

#9 @rob1n
18 years ago

  • Keywords has-patch removed

Heh, I just copied the code from rss_enclosure() and made it Atom-specific. I'll make a new patch.

@rob1n
18 years ago

#10 @rob1n
18 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.

#11 @ryan
18 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [4930]) Proper atom enclosures. Props rob1n. fixes #1464

Note: See TracTickets for help on using tickets.