Ticket #3635 (closed defect (bug): wontfix)
RSS feed and relative url gives warning
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | 2.0.7 |
| Severity: | normal | Keywords: | rss feed relative url |
| Cc: |
Description
This article describes how to link posts and pages:
http://codex.wordpress.org/Linking_Posts_Pages_and_Categories
It says one can create relative urls like this:
<a href="/index.php/mypage/">My Special Page</a>
If validating the feed with http://feedvalidator.org/, it will complain and say:
"content:encoded should not contain relative URL references: /index.php/mypage/"
Change History
comment:2
foolswisdom — 5 years ago
- Status changed from new to closed
- Resolution set to wontfix
- Milestone 2.2 deleted
Closing as WONTFIX, real feed readers that can't handle this are broken.
snakefoot and Otto42 thank you for participating! This is an interesting topic to me.
I recall reading recently:
"However, I will note in passing that this particular relative link is a full pathname that is only relative to the domain, so even if I did include this link in an RSS feed (which I haven’t), it shouldn’t present a problem for feed readers. There are only a finite number of reasonable choices for guessing the base URL of a relative link in an RSS feed — the feed URL, the entry URL, or the channel URL — and even though no RSS spec defines the right one, in this case they all share the same domain so they would all resolve to the same (correct) destination. If your feed reader isn’t choosing any of those, then it’s *really* broken, and I find it difficult to believe that my feed is the first place you’ve had a problem."
http://diveintomark.org/archives/2007/01/30/truth-hurts#comment-8130
comment:3
markjaquith — 5 years ago
I think Mark was mistaken in that instance, because he was linking to the same document.
See: http://www.apps.ietf.org/rfc/rfc3986.html#sec-4.4
What's really interesting is that people are now using those fragments as permalinks for AJAX-powered applications, because you can change that fragment in the location bar of the browser without refreshing the page. But then what happens if someone visits a URL that is [baseurl]#fragment1 and then from that URL tries to go to [baseurl]#fragment2 ? RFC3986 says that the browser shouldn't issue a new request, because it is considered a same document reference.
So, clever, but not foolproof.
As for this issue, we could fix it by running a preg_replace() filter on RSS content, but I don't know if it's worth it.

This is because most feed readers have no certain way to resolve a relative reference to the correct webpage. Some feedreaders can be smart about it, most can't.
The short of it is that you should really always use absolute references, but there's nothing forcing you to do so. This is not really a solvable problem from Wordpress's perspective. Bad stuff in posts = bad stuff in feeds.