Make WordPress Core

Opened 15 years ago

Closed 9 years ago

Last modified 9 years ago

#11438 closed enhancement (wontfix)

Make relative links absolute in feed

Reported by: caesarsgrunt's profile caesarsgrunt Owned by:
Milestone: Priority: normal
Severity: major Version: 2.9
Component: Feeds Keywords:
Focuses: Cc:

Description

Relative links should be made absolute for the feed, because / means nothing in a feed reader.

Change History (22)

#1 @strider72
15 years ago

This should absolutely be fixed in Core, but just FYI -- Ozh's "Better Feeds" plugin currently fixes this, I believe.

#2 @Denis-de-Bernardy
15 years ago

  • Milestone changed from Unassigned to Future Release
  • Type changed from defect (bug) to enhancement

don't all feed readers fix this on their end?

#3 @strider72
15 years ago

"don't all feed readers fix this on their end?"

If all feed readers fixed it on their end, nobody would have ever noticed the issue. QED. ;-)

#4 @Denis-de-Bernardy
15 years ago

We want names! :D

#5 @strider72
15 years ago

I was having the problem a while back in my Mac -- it was probably on NetNewsWire. I don't recall precisely, but that is the most likely app. (Possibly Apple's own "Mail"?) No doubt there are others, especially considering all the desktop programs *and* web-based services for this type of thing....

#6 @Denis-de-Bernardy
15 years ago

I'd vote plugin material, personally. It's like, sure it might be that there's a poorly written app here and there. But if the DOM gets parsed in the reader it's trivial to fix on their end. By contrast, it's a mess to fix on our end.

If we do decide to fix it, though, here's an anchor utils class that may come in handy:

http://plugins.trac.wordpress.org/browser/sem-external-links/trunk/anchor-utils/anchor-utils.php

#7 follow-ups: @hakre
15 years ago

  • Keywords reporter-feedback added

Relative Links? You mean those which are entered into the post by an author of an article? Isn't WordPress using absolute links everywhere? Which links are relative? Please provide steps to reproduce.

#8 in reply to: ↑ 7 @Denis-de-Bernardy
15 years ago

  • Keywords close added; reporter-feedback removed

Replying to hakre:

Please provide steps to reproduce.

enter this in a post:

<a href="/">foo bar</a>

then open the link in a very sucky feed reader. if it doesn't convert that to http://domain.com/, then sure enough the feed reader really sucks.

suggesting wontfix.

#9 @caesarsgrunt
15 years ago

  • Keywords close removed

An example feed reader is Google Reader. Also Feedburner email subscription. I'm sure there are others.

#10 in reply to: ↑ 7 ; follow-up: @caesarsgrunt
15 years ago

Replying to hakre:

Relative Links? You mean those which are entered into the post by an author of an article? Isn't WordPress using absolute links everywhere? Which links are relative? Please provide steps to reproduce.

Yes, I mean those entered into the post by the author. What WordPeess uses itself is irrelevant (I hate how it uses absolute links everywhere, but that's not relevant to this ticket).

#11 in reply to: ↑ 10 @hakre
15 years ago

Replying to caesarsgrunt:

Replying to hakre:

Relative Links? You mean those which are entered into the post by an author of an article? Isn't WordPress using absolute links everywhere? Which links are relative? Please provide steps to reproduce.

Yes, I mean those entered into the post by the author. What WordPeess uses itself is irrelevant (I hate how it uses absolute links everywhere, but that's not relevant to this ticket).

Oh well that would mean we need a XML parser then. I see no chance to handle that properly without PHP5 and DOMDOCUMENT. With the great FluentDom Lib this would be quite easy. But no luck here for WordPress with the current system requirements. Alternative is some crappy regex I guess.

#12 @dd32
15 years ago

Alternative is some crappy regex I guess.

such as the existing links_add_base_url($content, $base, $attrs = array('src', 'href'))

#13 @hakre
15 years ago

The base would be the permalink of the post?

#14 follow-up: @Denis-de-Bernardy
15 years ago

That would depend on the link:

  • links that start with a protocol should be left untouched. in particular mailto: links.
  • links that start with ../ or ./ should use trailing slashed domain + path (without the query string, etc.), possibly with the port, etc.
  • links that start with / ought to use the untrailingslashed domain, possibly with the port, etc.

it's a few tricky regexps. And I still think it ought to be closed as wontfix / left for feed readers to work out.

#15 in reply to: ↑ 14 @caesarsgrunt
15 years ago

Replying to Denis-de-Bernardy:

And I still think it ought to be closed as wontfix / left for feed readers to work out.

It's not up to feed readers to correct our bad feeds, it's up to us to produce correct ones.

Besides, we should be compatible with existing readers, particularly widely-used ones such as Google Reader.

If a link in a site's feed doesn't work, when links in other feeds do, it's the site that gets seen in a bad light by the viewer. It probably wouldn't occur to them that their reader could even fix it for them.

#16 @wojtek.szkutnik
15 years ago

  • Keywords gsoc added

#17 @solarissmoke
14 years ago

  • Keywords close added; needs-patch gsoc removed

Few points:

  • I can't believe that anyone uses relative links containing ../ in their posts (in any case we should not be encouraging it). Posts can be displayed in several contexts (single, monthly archive, yearly archive, category archive, etc), and in each case the ../ will point to something different. Breaking the link in a feed reader would be the least of your problems.
  • Root-relative links are a different matter, but there are other ways to deal with this. One is the xml:base attribute, which is used to specify the base for relative URLs. This can easily be done by a plugin using the rss2_ns action.
  • Most feed readers have got used to the fact that people use relative links, and have found ways to deal with it. This includes Google Reader and Feedburner.

Proposing wontfix (again). This issue has been raised before (#1748) and even there received no traction.

#18 @iseulde
11 years ago

  • Component changed from General to Feeds

#19 @stevenkword
9 years ago

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

Seeing that Google Reader has been sunset and this ticket is 4 years old, I'm going to close it as won't fix. If someone is able to reproduce the problem with root-relative links and provide a list of aggregators that don't support the current method, please open a new ticket explaining the problem with steps to reproduce.

#20 @netweb
9 years ago

  • Milestone Future Release deleted

#21 @strider72
9 years ago

  • Keywords close removed

Resolution should be "wontfix", not fixed"

#22 @stevenkword
9 years ago

  • Resolution changed from fixed to wontfix
Note: See TracTickets for help on using tickets.