Ticket #3377 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

Atom feed contradicts itself

Reported by: link92 Assigned to: markjaquith
Priority: low Milestone: 2.1
Component: General Version: 2.0.5
Severity: normal Keywords: has-patch
Cc:

Description

<summary type="text/plain" mode="escaped">

From a parser POV, what does this mean? Normally you only escape the content when you have HTML content, yet what we're given in the type attribute says it's text/plain. Since both are MAY [RFC2119] in Atom 0.3, many (if not all parsers) will just take one attribute and ignore the other. Fx 2.0 just treats it as unescaped plain text.

Attachments

wp-atom.php.patch (0.8 kB) - added by link92 on 01/06/07 23:09:23.
Change the MIME type of the <summary> to bloginfo('html_type') - patch should apply against 2.1 and 2.0

Change History

11/29/06 21:16:29 changed by shorty114

  • keywords set to bg|dev-feedback bg|2nd-opinion bg|needs-patch.
  • priority changed from normal to low.
  • version set to 2.0.5.
  • milestone set to 2.0.6.

It would make sense that once it's escaped, it can be used as text/plain. But maybe do type="text/html" instead?

11/29/06 21:17:17 changed by shorty114

  • keywords changed from bg|dev-feedback bg|2nd-opinion bg|needs-patch to bg|dev-feedback bg|2nd-opinion.

11/29/06 21:17:37 changed by shorty114

  • owner changed from anonymous to shorty114.
  • status changed from new to assigned.

I would be glad to do a patch but any devs have an opinion?

(follow-ups: ↓ 6 ↓ 7 ↓ 8 ) 11/29/06 21:22:10 changed by matt

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

Since our feeds currently work everywhere, I'm not inclined to change this.

12/08/06 15:01:07 changed by markjaquith

  • milestone deleted.

(in reply to: ↑ 4 ) 12/08/06 19:10:17 changed by link92

Replying to matt:

Since our feeds currently work everywhere, I'm not inclined to change this.

Huh? As I said in the report, it breaks in Fx 2.0.

(in reply to: ↑ 4 ) 12/08/06 19:37:13 changed by link92

<summary type="text/plain" mode="escaped"><![CDATA[This &amp;amp; this]]></summary>

Will come out of almost every parser as meaning a summary with contents of "This &amp;amp; this" which is plain text.

<summary type="text/plain" mode="escaped">This &amp;amp; this</summary>

Will come out of almost every parser as meaning a summary with contents of "This &amp; this" which is plain text.

The real issue is that we have text content which is escaped (which under the Atom 0.3 spec means nothing more than just follow the normal XML rules (eg. remove entities in PCDATA, but not CDATA)), and that it is plain text and therefore the data is the raw content after being escaped. The two options for this are to:

  1. Remove the CDATA section, so the entities are decoded by the parser,
  2. Change the MIME type to text/html, so it's parsed by an HTML parser.

(in reply to: ↑ 4 ) 12/08/06 19:38:43 changed by link92

Replying to matt:

Since our feeds currently work everywhere, I'm not inclined to change this.

Also, what feed parsers does it work in (most feed parsers just show the content, not the summary, so it's futile naming any like that)? Anything that it works in is horribly broken.

12/19/06 21:22:45 changed by link92

  • status changed from closed to reopened.
  • resolution deleted.

I'm reopening this on grounds that nobody has questioned what I said above (and that therefore it still exists).

01/06/07 23:01:16 changed by link92

  • milestone set to 2.1.

01/06/07 23:09:23 changed by link92

  • attachment wp-atom.php.patch added.

Change the MIME type of the <summary> to bloginfo('html_type') - patch should apply against 2.1 and 2.0

01/06/07 23:10:41 changed by link92

  • keywords changed from bg|dev-feedback bg|2nd-opinion to bg|dev-feedback bg|2nd-opinion has-patch.

01/07/07 02:14:10 changed by matt

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

(In [4688]) Summaries in Atom should properly describe their content, fixes #3377. Hat tip: link92.

01/08/07 16:41:38 changed by markjaquith

  • status changed from closed to reopened.
  • resolution deleted.
  • milestone changed from 2.1 to 2.0.7.

01/08/07 21:05:51 changed by foolswisdom

  • keywords changed from bg|dev-feedback bg|2nd-opinion has-patch to has-patch.
  • owner changed from shorty114 to markjaquith.
  • status changed from reopened to new.

01/10/07 13:56:32 changed by markjaquith

  • milestone changed from 2.0.7 to 2.0.8.

Let's let this sit in 2.1 for a bit

01/26/07 14:48:36 changed by link92

This is now broken again in trunk: <summary> isn't allowed to have a MIME type on @type (in Atom 1.0 only <atom:content>'s @type allows a MIME type). The best thing to do is probably just hardcode @type="html".

01/29/07 12:37:30 changed by link92

I might add that due to it being a MIME type, it now defaults to "text", which brings us back to where this bug started.

01/29/07 22:11:51 changed by foolswisdom

link92, the patch above if applied for 2.0.8 would not have the problems you describe in the two comments above? 2.1 currently is broken in this way or only trunk?

For my brains sake would it makes sense to split off new bugs based on the modified implimentation in 2.1 or trunk? Please.

01/29/07 22:49:17 changed by link92

2.1 fixes this bug. 2.0 still has this bug. 2.2 has the problems in my last two comments.

01/30/07 19:31:23 changed by markjaquith

  • milestone changed from 2.0.8 to 2.0.9.

link92, please open a separate ticket for the issue in 2.2 (which now has Atom 1.0)

2.1 just came out, so this needs to sit there until 2.0.9

02/21/07 14:55:34 changed by Nazgul

  • milestone changed from 2.0.9 to 2.0.10.

2.0.9 is out, so bumping the milestone to 2.0.10.

03/19/07 18:20:28 changed by foolswisdom

  • milestone changed from 2.0.10 to 2.0.11.

04/07/07 17:46:22 changed by link92

Surely this has sat in 2.1 for long enough?

06/04/07 19:01:20 changed by foolswisdom

  • milestone changed from 2.0.11 to 2.0.eventually.

09/02/07 18:51:57 changed by rubys

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

This defect was fixed in WordPress 2.2, as a byproduct of supporting Atom 1.0.

09/02/07 19:14:19 changed by foolswisdom

  • status changed from closed to reopened.
  • resolution deleted.

Re-opening as this ticket was/is targetted at the long term maintenance 2.0.x branch.

09/03/07 00:12:53 changed by rubys

re: re-opening, fair enough; though as one of the authors of that spec, the problem isn't that Wordpress produced an invalid feed, it is that that version of the spec itself was ambiguous.

09/03/07 16:57:20 changed by markjaquith

  • status changed from reopened to closed.
  • resolution set to fixed.
  • milestone changed from 2.0.eventually to 2.1.

In that case, we have even less reason to change this. It's fairly hard for us to get changes like this into the 2.0.x branch because of pressure from the Debian side to limit it to security/stability issues.