Ticket #1464 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

wp-atom.php produces invalid enclosure

Reported by: raster Assigned to: rob1n
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

1464.diff (1.4 kB) - added by rob1n on 02/21/07 05:09:26.
1464.2.diff (2.2 kB) - added by rob1n on 02/23/07 23:43:13.

Change History

06/23/05 12:19:54 changed by raster

  • keywords set to atom enclosures podcasting videoblogging.

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.

02/21/07 01:21:36 changed by rob1n

  • keywords changed from atom enclosures podcasting videoblogging to needs-patch.
  • 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.

02/21/07 02:44:57 changed by rob1n

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

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

02/21/07 04:55:48 changed by rob1n

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

02/21/07 05:09:26 changed by rob1n

  • attachment 1464.diff added.

02/21/07 05:10:26 changed by rob1n

  • keywords changed from needs-patch to has-patch.

Patch added that includes a new function (atom_enclosure), and replaces the call to rss_enclosure() in wp-atom.php with atom_enclosure().

02/23/07 00:34:28 changed by ryan

  • cc set to dougal.

02/23/07 00:34:45 changed by ryan

I'll ping dougal for his input.

02/23/07 18:17:30 changed by dougal

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.

02/23/07 23:36:28 changed by rob1n

  • keywords deleted.

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

02/23/07 23:43:13 changed by rob1n

  • attachment 1464.2.diff added.

02/23/07 23:44:09 changed by rob1n

  • keywords set to has-patch commit.

Okay, new patch is (hopefully) final. I also took the liberty of rewriting rss_enclosure(), as that code made no sense whatsoever.

02/23/07 23:47:59 changed by ryan

  • status changed from assigned to closed.
  • resolution set to fixed.

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