Problem/Motivation
- The root cause of this mess: the fact that Drupal generates file URLs without knowledge about the context those URLs will be used in. But the place where a file URL is generated in may itself not know the context either! For example, an image may be rendered into HTML and then that HTML may happen to be sent in an e-mail (or RSS), and therefore the URL should be absolute. But that was impossible to know at the time when the image template was being rendered (for example when rendering an article to be sent via e-mail, the rendering of the article is not at all different: it's still rendered to HTML).
- Any time you're sending HTML in a non-web context (for example: e-mail, RSS), you have to make sure all URLs are absolute. But
file_create_url()is only invoked on files referenced by code. A complete solution would already have to make all relative URLs absolute anyway, including those in user-generated content.
Proposed resolution
The only sensible solution is to solve the problem at its root. Write a response event subscriber (a response filter
in Symfony terminology) that updates all relative URLs in RSS responses to be absolute.
Remaining tasks
Test coverage.- Reviews.
User interface changes
None.
API changes
None.
Data model changes
None.
Original issue summary
The feeds Drupal creates include node->teaser or node->body (depending on configuration) in the description fields items. This text can contain relative links to other content on the same domain. Many aggregators, including Drupal's own and bloglines.com, can not handle these relative links. The RSS specification specifies that all links should be absolute.
The attached patch fixes the feed descriptions in format_rss_items (common.inc). It adds a function named 'filter_absolute_urls' to common.inc, which can also be used by aggregator.module and other modules that need absolute urls (such as modules that send out emails).
There are alternative approaches to this fix. One could be to use nodeapi 'rss items' hook, using a contrib module. However in the current implementation of this hook in node.module, modules can not modify the body and/or teaser of items. The cleanfeeds module uses this approach, and needs a patch for node.module to get it to work.
Another approach would be to enable the filter system for feeds, and make a filter which creates absolute urls. Having a 'filter_absolute_urls' function in common.inc would still be very usefull in this scenario.
The 'filter_absolute_urls' function can probably be made a little bit more efficient; I currently have two regexps, one for relative urls ("path/to/somewhere") and one for urls relative to the domain root ("/path/to/somewhere").
| Comment | File | Size | Author |
|---|---|---|---|
| #119 | 88183-2-119.patch | 16.11 KB | alexpott |
| #119 | 113-119-interdiff.txt | 1.6 KB | alexpott |
| #113 | 88183-113.patch | 16.53 KB | wim leers |
| #104 | 88183-104.patch | 16.58 KB | wim leers |
Comments
Comment #1
ednique commentedSame problem here...
when content is published on other sites, links are wrong as they don't contain a full url...
Comment #2
ahoeben commentedI guess this issue is not getting much attention because its against 4.7.x as opposed to CVS.
I'll see if I can find time to install CVS and see if the problem persists in the current CVS. Nevertheless, this is an ugly issue in 4.7.x too, because the aggregator in Drupal is not even displaying its Drupal generated feeds properly.
Comment #3
magico commented1. create a node
2. insert a relative link (eg. href="node/add")
3. access the rss.xml
4. links are still relative and must e absolute
Comment #4
dmitrig01 commentedComment #5
phillipadsmith commentedThis is a pretty major issue. Any update on it?
Comment #6
Anonymous (not verified) commentedThe added function needs some phpDOC comments. This hasn't seen the light of day because the status is set to patch (code needs work) meaning that someone has reviewed the code and decided that it needed work. Others will not look until it is patch (code needs review). So once you've made the changes, change the status.
Comment #7
phillipadsmith commentedJust pointing out that it seems like a relatively big issue to leave open. The RSS spec asks for absolute URLs and Drupal is producing relative ones -- so Drupal RSS feeds won't validate (or, in some cases, work at all).
FYI: to those that are really stuck with this problem, you can set the $base_url in settings.php and that will add a absolute path to all of your RSS feed links.
Phillip.
Comment #8
bessone commentedI have copied this function on my common.inc (drupal 5.2) and after add the call on format_rss_item function in that way:
and works!!! Now no problem with feed and feedburner!
Thanks!!!
Saluti
BES
Comment #9
Anonymous (not verified) commented@ahoeben: Are you planning to provide a modified patch to provide the comments?
Comment #10
drummI would like to see this get into 6.x first. Here are problems I see:
- Function documentation is incomplete. Need more @param and @return.
- Second return statement is never reached.
Comment #11
wim leersReroll, with some comments.
Comment #12
wim leersComment #13
steven jones commentedThe token amount of documentation is just not enough.
Rename the parameter $url to $html, as you're not passing in one url at a time to this function, you're passing in html.
Change the documentation to something like:
@param $html
A block of html containing relative and absolute urls in 'src' and 'href' attributes
@param $absolute_url
An absolute URL that points to this Drupal website.
Is the second parameter really needed for this function? why can't we just use url('')?
Comment #14
chx commentedCleanup and comments. Changed the name of the function -- you must not call this filter* something as it's outside of filter module namespace.
Comment #15
snufkin commentedtested with relative and absolute paths (e.g.: /node/add/story, node/add/story, fullurl.com/node/add/story), all three gives the same, correct results in the feed as absolute url.
Comment #16
dmitrig01 commenteddoes it work relatively in a subdirectory?
If your install is in
drupaland you link to/drupal/node/adddoes it work?Comment #17
snufkin commentedmy drupal installation was located under http://localhost/projects/drupal/drupal6 and it worked
Comment #18
ahoeben commentedThanks for picking this up! Had to take a break from Drupal for a while, sorry 'bout disappearing... Patch looks good, works for me.
Comment #19
gábor hojtsyConceptual issues:
- I can't sew how does this handle some situations, like if I have a link from http://example.com/news/local to "worldwide", which is a relative link to "http://example.com/news/worldwide".
- I see that the second preg matches a link to '/', but I found it hard to come up with examples myself for cases when the first matches or when the second matches. In other words: why do we need two different matchers?
- This function only matches lower case attribute names, which might not be that big of a problem for those following XHTML rules, but frankly, not everyone cares. I am not too comfortable with doing a case insensitive match, because it is a lot sloooooooower, then what we have now, but this still need to be on our mind.
Cosmetic issues:
- "html" should be "HTML" in comments
- The function does not concentrate on "a href", but rather "... href", so this should be corrected. Other tags have href attributes, so this is not exclusive to "a".
Comment #20
ahoeben commentedReroll of my original patch, with cosmetic changes and documentation.
The second argument to the function is useful to have:
Comment #21
ahoeben commentedwoops
Comment #22
chx commented,$base_document misses a space.
Comment #23
ahoeben commentedBefore I roll a new patch for that space, any more opinions on whether or not we should do case insensitive pregs instead? I am partial to case insensitivity, since the result of this function will likely be cached anyway...
Comment #24
ahoeben commentedNew patch
Comment #26
ahoeben commentedThank you, mister DrupalTestbedBod. Is this patch better?
Comment #27
dries commentedThis isn't a bug, IMO. I'm not a big fan of regex'ing things into place.
The XML specification provides a clean solution for this; the xml:base attribute. The feeds generated by Drupal support include this attribute. What needs fixing is the aggregator module, not the feed generation.
In documentation, we write 'URL', not 'url'.
Comment #28
ahoeben commentedPoint taken for outgoing RSS feeds.
However, there are still situations where the suggested 'drupal_force_absolute_urls' function is useful; One such situation would be for applying the xml:base attribute to relative links on incoming RSS feeds.
IMHO it is still a critical bug for 6.x that Drupal can not correctly aggregate its own feeds. I'm a bit reluctant to mark this as an 'aggregator.module' bug, because there are other situations where the same problem exists and where xml:base is not a solution. Links in outgoing emails for example.
Comment #29
wolfderby commentedsubscribing
oh I just changed the version because I thought people wouldn't be working on it, if it's not the current version. n00b mistake apparently sorry :(
this is beyond my current capabilities and I hope it gets fixed!
Comment #30
wim leersVersion shouldn't have been changed.
Comment #31
chx commentedIs this still a problem? I bet it is! Someone please reroll it and add a test.
Comment #32
grendzy commentedPer Dries' comment #27, moving to aggregator.module. And, features are really 8.x now. Though if someone wants to try to argue that not implementing the aforementioned "xml:base attribute" part of the RSS spec is a bug, this might have a shot at 7.x. (This is frustrating, not a day goes by without broken links and images on Drupal Planet.)
Also marked #395764: Aggregator: Convert all relative URLs to absolute URLs in feed items as a duplicate.
Comment #33
gábor hojtsyOh, its totally a bug. Even to be backported to Drupal 6 if at all possible.
Comment #34
gábor hojtsyComment #35
gábor hojtsy#395764: Aggregator: Convert all relative URLs to absolute URLs in feed items has a working patch for Drupal 7 that only needs tests. Asked @brianV to move the patch over.
Comment #36
brianV commentedAs requested by Gabor, here is the patch from the other issue.
Note that this patch applied cleanly in March, 2009, so is going to need to be updated to current HEAD. Also, it needs a test case.
I would appreciate if someone else take it over from here, as I don't have the free time to focus on it for the next while.
Comment #37
sun1) Trailing white-space.
2) See http://drupal.org/node/1354 for code documentation standards.
You likely want to use drupal_parse_url(), which probably simplifies this code a lot.
Powered by Dreditor.
Comment #38
brianV commentedI found some time after all to produce an updated patch w/ sun's feedback. Note that there is still no test case.
Comment #39
brianV commentedSince I know it's only a matter of time until it's pointed out - rev7 is attached which fixes the extra whitespace...
Comment #40
brianV commentedSetting to CNW. I realize that I forgot about the case where things are relative to the root - they should be against the working dir.
Comment #41
brianV commentedHere is a new revision. I went back to the old parse_url() logic, as that drupal_parse_url() doesn't give the base url of the link, which is needed in one of the two use cases.
Comment #42
brianV commented*facepalm*
Ignore that last patch. Sorry about wasting your time and attention. I'll have a new roll on Monday when I'm a little less burnt out.
Comment #43
sun.core commentedThis bug seems to exists for a long time already, so the major priority isn't qualified.
1) Trailing white-space.
2) Duplicate + signs indicate a wrongly re-rolled patch.
Powered by Dreditor.
Comment #44
jody lynnComment #45
marvil07 commentedDocumentation for that on w3c. It define it in a way that the URLs should be resolved with the nearest parent which define the attribute.
So, I guess the idea here would be to use the last patch, but use:
instead of
The patch with this comment adds the definition of
xml:baseto the channel array during xml parsing, but only for the top level.It identifies top level by asking the element name: rss, feed(atom) or rdf:RDF(rdf).
To actually do it to support the full specification, we would need to ask for current attributes of "description" elements, and if not defined ask to all parents until find it or reach the root.
I'm not sure if we want to do that here(sounds more like a feed/xml parser library feature), or this approach would be enough, but it would solve at least some of the problem.
So, we anyway will need to do regex's to replace the links(so we do it once), but with the attached patch we are also trying to use xml:base if defined.
Comment #46
marvil07 commentedThis patch fixes the re-roll on #41 and adds what is mentioned on #45.
Comment #47
wim leersI'm afraid this needs a test case? I think I also found an edge case that is not yet properly supported, but which should NOT prevent this patch from going in, because this is going to fix 99.5% of all cases already, which is better than where we're at today.
Some CMSes use the colon (':') in their URLs, e.g. for filtering search results: http://example.com/magicalSearchPage:filter:foo.
Comment #48
corbacho commented#46
That regex will fail also, because it will capture protocol-less URLs, when it shouldn't
<img src="//drupal.org/sites/all/themes/bluecheese/images/btn-search.png" />This type of URLs are mostly useful in these cases, when the content goes outside of your domain (like me reading drupal planet news in Newsblur reader), and you don't know if the RSS-reader domain is using http or https.
( In a positive note... I don't think many modules use this type of URLs for images)
Final note: I haven't noticed before Drupal Planet broken images because Google Reader fixes on-the-fly the "relative path" issues, replacing them with absolute paths. But G.Reader will die soon.. and the alternatives out there are not that smart. (I verified Newsblur and feedly)
Comment #49
twistor commentedparse_url() returns FALSE on failure.
scheme might not be set.
need to handle port.
protocol relative urls.
pathinfo($item_url_parts['dirname'], PATHINFO_DIRNAME);
These regexps will over match. We need at least the <> in there.
Also, 'codebase' and 'code' attributes can contain urls.
Is there are reason that we're not using the dom here?
Comment #50
twistor commentedAlso 'user' and 'pass' should be supported in parse_url().
and ipv6 hosts with something like:
Comment #51
john franklin commentedThose regexes are missing all the special characters that can be in a URL, including underscore, dash and period.
I think the regex needs to be closer to this to get 99.5% coverage.
Edit: The added back in uppercase letters.
Comment #52
fomenkoandrey commenteda similar problem in Drupal 8.0.3
all is well in the feed.
but when displaying the contents of the feed on other site - no images.
relative link does not work on another site, images are not displayed.
do for so many years and did not fix this bug? Is there a way to solve the problem in Drupal 8?
Comment #53
wim leersAs #52 just showed, this is also still a problem in Drupal 8.
In fact, #1494670: References to CSS, JS, and similar files should be root-relative URLs: avoids mixed content warnings & fewer bytes to send made all file URLs relative, and in doing so, made this problem more prominent. But it's always been a problem, because we never solved it on the right level. See #1494670-121: References to CSS, JS, and similar files should be root-relative URLs: avoids mixed content warnings & fewer bytes to send and later. Let me in particular repeat the most relevant bit of my analysis in #1494670-143: References to CSS, JS, and similar files should be root-relative URLs: avoids mixed content warnings & fewer bytes to send:
So let's fix this once and for all.
Comment #54
wim leersThis transplants the patch from #1494670-143: References to CSS, JS, and similar files should be root-relative URLs: avoids mixed content warnings & fewer bytes to send to here.
Fun fact: I first worked on this almost 9 years ago: #11.
Comment #55
wim leersComment #56
wim leersLetting this inherit the critical priority from #1494670: References to CSS, JS, and similar files should be root-relative URLs: avoids mixed content warnings & fewer bytes to send — up to the committers to decide otherwise.
Comment #57
wim leersAnd now also transplanting #1494670-145: References to CSS, JS, and similar files should be root-relative URLs: avoids mixed content warnings & fewer bytes to send.
(#54 should fail.)
Comment #59
wim leersAnd here's test coverage. The test-only patch also is the interdiff.
Comment #60
wim leersComment #61
wim leersBerdir is going to take on #2704597: Relative URLs in mails should be converted to absolute ones and asked me to move the key logic he'll need there into the
Htmlutility class. That will make his job easier over there.Comment #65
wim leersRebased #61.
#59's non-test-only patch should have passed, I'm 99% certain this is due to a small mistake in the test and the fact that testbot installs Drupal in a subdirectory. So I added a debug patch.
Comment #68
eric_a commentedIf symfony/http-foundation is going to be a drupal/core-utility component dependency then core/lib/Drupal/Component/Utility/composer.json needs an update now that #2337283: Add a composer.json file to every component got into 8.1.x.
Comment #69
twistor commentedDo we want to match against the appropriate tag names?
This should just pass in the $base_url as string or
Psr\Http\Message\UriInterface, rather than a full Request object. It removes the dependency on Symfony, and makes it usable generically. Also why are we skipping other types of relative URLs that may appear in body content? I think that would also fix the bug about sub-directories. We need something likePsr\Http\Message\UriInterface::resolve().Comment #70
dawehnerit is a component so it should not depend on another code, just pass in the schema and host as variable.
Comment #71
kylebrowning commentedThis attempts to fix #70, I'm assuming we meant base_root instead of $base_url, but an easy change if not.
Did not attempt to fix #69.1 though.
Comment #72
kylebrowning commentedLost a parenthesis, whoops.
Comment #73
wim leersInconsistent.
From injected data to a global. This is very bad.
Inconsistently inconsistent…
So, first, let's make the patch green. Then let's address the concerns raised (which I totally agree with). Interdiff relative to #65.
Comment #74
wim leers#68-#72: nice, I move one small subset into a component at Berdir's request and I get loads and loads of feedback.
#68: Indeed, fixed.
#69:
RE: "other types of relative URLs": no, we don't need/want to update protocol-relative URLs.
No, supporting protocol-relative URLs wouldn't have fixed the bug about subdirectories.
Yes, something like
\GuzzleHttp\Psr7\Uri::resolve()could be nice, but I've yet to see relative URLs using periods in Drupal. And no, that doesn't live on PSR'sUriInterface, it's something specific to Guzzle's implementation of that interface.#70: done.
#71/#72: cleaned up your implementation.
Having written all this made me realize something, see next comment.
Comment #75
wim leersD'oh, syntax error.
Comment #77
wim leersSo Twistor makes a great overall point in #69: if we have this in the
Htmlcomponent, it should truly be generic. But it's not actually generic right now.However, he's actually wrong. And I'm wrong too! We're both wrong :)
I'll explain why.
The current patch is actually broken. Despite passing tests. Because the test I wrote is wrong.
The whole reason we're doing this is because of #1494670: References to CSS, JS, and similar files should be root-relative URLs: avoids mixed content warnings & fewer bytes to send. That made it so that pretty much all file URLs are made root-relative using
file_url_transform_relative().But the test makes it so that
<a href="/foo">on a sitehttp://example.com/drupalgets changed to<a href="http://example.com/drupal/foo. But actually,/foowas not pointing inside Drupal in the first place.More concrete example:
file_url_transform_relative(file_create_url('public://llama.jpg'))generates/sites/default/llama.jpgif Drupal runs athttp://example.com, and generates/drupal/sites/default/llama.jpgif Drupal runs athttp://example.com/drupal. That's why it's a root-relative URL: it means it's relative to the site's root. So we only need to prepend the scheme and host, not also the base path.So the changes I made in #73 were wrong, I should've fixed the tests instead.
Therefore, this patch:
Html::transformRelativeUrlsToAbsolute()toHtml::transformRootRelativeUrlsToAbsolute(), which causes it to now actually match its documentationHtml::transformRootRelativeUrlsToAbsolute()explaining why relative URLs other than root-relative URLs are not being transformed$base_urlto$scheme_and_hostNext: unit test coverage.
Comment #78
wim leersAnd here's unit test coverage.
Comment #79
wim leersComment #80
xjmI don't think this meets the definition of a critical bug. It is however a major bug with feed functionality.
Comment #81
alexpottDiscussed with @catch. Unlike the similar #2704597: Relative URLs in mails should be converted to absolute ones this issue, which was made way worse by #1494670: References to CSS, JS, and similar files should be root-relative URLs: avoids mixed content warnings & fewer bytes to send is entirely core's problem and in my mind is critical bug - images in displayed in feeds no longer work and core is just doing it wrong.
Comment #82
alexpottNeeds a reroll.
Comment #83
alexpottComment #84
alexpottA few tidy ups.
Comment #85
alexpottWe've not included code, codebase, data, and manifest. Should we document why they are not here?
Comment #86
wim leers#84: thanks for fixing all those nits! All look great.
#85:
Sure. Proposal:
dataexists for<object>and I guess that still is a thing that exists and should work. Of course, 99.99% of the time, it's for e.g. YouTube embeds. But, you never know. So, shall we add support for that one after all?Comment #87
alexpott+1 :)
I like all the suggestion in #86 including including the data attribute.
Comment #88
wim leersGreat :) Will reroll then!
Comment #89
wim leersVoilà.
Comment #90
dawehnerIts weird that we test generic core functionality as part of node module. This IMHO belongs somewhere else
What about srcset?
Comment #91
alexpottAnd form actions... https://stackoverflow.com/questions/2725156/complete-list-of-html-tag-at...
Comment #92
alexpottDiscussed with @catch, @xjm, @effulgentsia, @Cottser and @webchick. They've convinced me that this is not a critical bug. The reasoning is that the feed is still functional and the lack of absolute links is results is just a visual issue and the link to the site providing the feed will still work.
I think the patch is close - once we've got all the html attributes then we should be good.
Comment #93
kylebrowning commented@alexpott, so to be clear, we need any html attribute that has a src attribute?
Comment #94
alexpott@kylebrowning see https://stackoverflow.com/questions/2725156/complete-list-of-html-tag-at...
Comment #95
kylebrowning commented@alexpott Right I see that, but are formactions really going to come through RSS feeds? Can you be more specific on which html attributes are actually missing, versus needed, it seems the html4 ones are covered.
At any rate, here is a re-roll.
Comment #96
wim leers#90.1: I agree with that, but it's out of scope here. There is no pure RSS test! If there were, I'd be adding this to that. We shouldn't overhaul general RSS test coverage here. This is the best place.
#90.2: dammit, what a great find! :(
#95: there's something wrong with that reroll, there's a syntax error in there, in a part that didn't conflict. After fixing that syntax error, it's still failing, so there's another bit wrong. Rerolled it myself, now the problem is gone. Easier than hunting it down :) Probably the cat's fault! :D
Hence interdiff relative to #89.
So, NW for:
action:<form action>formaction:<button formactionicon:<command icon, but per https://developer.mozilla.org/en-US/docs/Web/HTML/Element/command, this is effectively gonesrcset:<img srcset>Addressed all of this.
Comment #97
kylebrowning commentedThanks Wim, just tested this too.
Comment #99
alexpottWe need to remove the second line here.
It looks as though the test text was intended to vary but everythign says root-relative
What's wrong with an else? Or considering it is different just doing srcset outside the loop?
Comment #100
wim leers#99:
git diff --color-wordsif you would like to convince yourself. See attached screenshot for that.else, I just wanted to reduce the interdiff size, and it stood out more, stressing it was the exceptional case.I think it may indeed be cleaner to pull it out of the loop.
Doing point 3 separately to make the steps/interdiffs simpler.
Comment #101
wim leersAccidentally RTBC'd #100, sorry.
And here's the screenshot I promised.
Comment #102
wim leersThis addresses point 3.
Ready to be RTBC'd again IMHO.
Comment #104
wim leersPHPStorm--
(It was doing very strange stuff with reformatting code whenever I typed a curly brace — yes, really, I couldn't believe it either! — and this caused me to mess a few things up :/)
Comment #105
kylebrowning commentedComment #106
alexpottComment #107
alexpottComment #108
alexpottWhy are these changes necessary to fix the bug?
Comment #109
wim leers@alexpott Because it's brittle parsing. Look at the raw output. Because it is processed by
DOMDocument, it adds some top-level attributes:These are completely harmless, but because we're doing raw string comparison instead of properly parsing XML, our tests fail.
(This is why we should never use
assertRaw().)Comment #110
alexpottSo looking at a before and after of the frontpage rss.xml with a single node with a body with some links and an image... Here is a git diff --color-words output...

The files used to generate this are also attached.
So there are some interesting changes...
utf-8"and?>- that can be done in a followup.about="/user/1"is not canonicalLeaving at rtbc but more opinions about the change to escaping would be nice.
Comment #111
alexpottSo I think we should have the followups for #110.1 and #110.5 open before commit - also I think we need at at least a comment on the issue about the change to escaping and why it is okay. I think it is as I said before more opinions are welcome.
Comment #112
kylebrowning commented@alexpott, any reason the #110.5 shouldn't be handled in this issue?
Comment #113
wim leersAgreed that #110.5 can be done here. Done.
#110.1 is so incredibly minor. Those spaces are not meaningful anyway. If @alexpott still wants that, I'd be happy to create a follow-up though.
Comment #114
brianV commentedFollow up issue for #110.1 created: https://www.drupal.org/node/2772887
#113 looks good to me, so setting to RTBC.
Comment #115
alexpottSo we still haven't had any comment about the escaping change shown in #110. I think it is an okay consequence since the " is not a special character in XML with a field and therefore we're sending less bytes which is a good thing. But it'd be nice for someone else to consider implications before committing this patch.
Comment #116
wim leersI also don't see any problems in
"becoming". I think this is the sort of change you have to roll out and then see if there are any real-world problems with it or not. There's such a broad variety in RSS readers, that it's impossible to predict if this will cause problems or not.The most reassuring thing I can think of, is testing with https://validator.w3.org/feed/. No difference there.
Comment #117
kylebrowning commentedAnyone we know we can task with this review?
Comment #118
twistor commentedI don't think there's a problem with converting
"to". In fact, I think that's more standard than escaping it.I could list a bunch of popular feeds that leave quotes alone, here's two:
Comment #119
alexpottI think our standards prefer long descriptive names over short and incorrect english ones... ie 2 != to :)
Plus obviously htmlRel2abs() does not exist anymore.
Given this is a minor refactor leaving at RTBC.
Comment #120
alexpottMy contributions to this issue have been all nits and coding standards. It's great to see this fixed - and nice to see that Drupal 8's architecture makes fixing this type of thing a bit easier.
Committed and pushed 417d9006232b6746c0716bac4601afcfd2a19310 to 8.2.x and da4b6e6 to 8.1.x. Thanks!
Comment #123
wim leersYay!
Comment #124
alexpott10 year old bugs that affect people's Drupal planet feeds feels worthy of a release note mention :)
Comment #125
wim leers#124: I was secretly hoping for that :D
Comment #128
ahoeben commentedAww, I had an alarm set to celebrate the 10th anniversary of this issue and everything... ;-)
Yay, it's fixed!
Comment #129
fomenkoandrey commentedworks!
Comment #131
Anonymous (not verified) commentedCan this be backported to Drupal 7?
("No" is a fine answer... but it would be nice to have a definitive one, either way.)
Thanks! (I hope changing to version 7/active is not incorrect here!)
Comment #132
wim leers@ahoeben Hah! :D :D
Comment #133
alexpott@ahoeben - so in order to backport this - under the new policy we open a new issue linked to this one. However I think backporting might prove tricky given all the previous discussion.
Comment #134
berdirHm. I noticed that having twig debug enabled combined with this results in *very* weird stuff. Basically, all you get is page with the opening <?xml version="1.0"?> and nothing else. And a bunch of parsing errors when you check the logs/another page.
It was always a bit weird with that (displaying xml with a template is pretty crazy :)) but this made it quite a bit worse.
Comment #135
berdirAnd based on my tests, this also caused a small behavior change: double quotes are no longer encoded. I used to look for the raw string '<a href="' to make sure that things are escaped exactly once (remember how often we broke this? ;)), but now it is ''<a href="'.
I suppose that's not wrong but it is different, so I thought it's worth mentioning.
Comment #136
berdir#2801097: Converting feed to absolute URLs fails on invalid XML, results in empty output
Comment #137
twistor commented@berdir, the quote encoding issue was addressed from #110 on.
Comment #138
james.williamsFeeds coming from the render cache don't get their relative URLs converted - so I've opened #2959134: Relative URLs in cached feeds should be converted to absolute ones.
Comment #139
keithdoyle9 commentedIs there an issue already submitted about having absolute URLs in templates be absolute instead of relative? All my nodes currently have relative URLs for canonical links which are invalid.
Comment #140
james.williams@keithdoyle9 this ticket was very specifically about URLs in feeds. I think you're looking for #2738373: Canonical link should be absolute.