Permalink
Browse files

comment permalinks in xml feeds are now valid URIs

previously, comment permalinks in xml feeds were missing the scheme and
authority segments (protocol and hostname). this caused problems with
feed readers and other programs that expected to encounter a valid URI.
  • Loading branch information...
1 parent 400910e commit 2c3379c5e38c39f78eff2129a42191e72ace88aa @idonthack idonthack committed with spladug Oct 21, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 r2/r2/templates/comment.xml
@@ -22,6 +22,7 @@
<%!
from r2.lib.filters import safemarkdown
+ from r2.lib.template_helpers import add_sr
%>
@@ -32,12 +33,14 @@
else:
author = thing.author.name
body = thing.body
+
+ permalink = add_sr(thing.permalink, force_hostname = True)
%>
<item>
- <guid isPermaLink="true">${thing.permalink}</guid>
+ <guid isPermaLink="true">${permalink}</guid>
<title>${author} ${_("on")} ${thing.link.title}</title>
- <link>${thing.permalink}</link>
+ <link>${permalink}</link>
<dc:date>${thing._date.isoformat()}-0700</dc:date>
<description>${body|h}</description>
</item>

0 comments on commit 2c3379c

Please sign in to comment.