summaryrefslogtreecommitdiff
path: root/app/views/rss/updates.xml.builder
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-08-09 23:31:35 +0200
committererdgeist <erdgeist@erdgeist.org>2026-08-09 23:31:35 +0200
commit5690cf4d4e05eafdfd2e270bbdf1a925114d0f76 (patch)
tree1315dd1b91433f5287208a4f1b321dd722592966 /app/views/rss/updates.xml.builder
parent4d8c7290adf8dd41677ccc44a5c5ffe5d1bed2f6 (diff)
Escape feed content with Builder rather than by hand
Builder escapes by default; the three feed templates no longer call CGI.escapeHTML. This fixes two sites that never escaped at all: the tag feed's externally supplied :tag segment, interpolated into its title, self link and id, and dc:creator in the RDF template. Subscribers see one difference: quotes and apostrophes arrive raw, which is valid in element text. config/initializers/xmlparser.rb, which redefined Builder::XmlBase#_escape as the identity function, is gone. XML::Node#replace_with went with it, no callers.
Diffstat (limited to 'app/views/rss/updates.xml.builder')
-rw-r--r--app/views/rss/updates.xml.builder6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/views/rss/updates.xml.builder b/app/views/rss/updates.xml.builder
index a2c277d6..f09d6a74 100644
--- a/app/views/rss/updates.xml.builder
+++ b/app/views/rss/updates.xml.builder
@@ -12,7 +12,7 @@ xml.feed(:xmlns => "http://www.w3.org/2005/Atom", "xml:base" => @host) do
12 12
13 @items.each do |item| 13 @items.each do |item|
14 xml.entry do 14 xml.entry do
15 xml.title(CGI.escapeHTML(item.title.to_s)) 15 xml.title(item.title.to_s)
16 xml.link( 16 xml.link(
17 :href => content_url(:page_path => item.node.unique_path), 17 :href => content_url(:page_path => item.node.unique_path),
18 :rel => "alternate", 18 :rel => "alternate",
@@ -21,8 +21,8 @@ xml.feed(:xmlns => "http://www.w3.org/2005/Atom", "xml:base" => @host) do
21 xml.id(content_url(:page_path => item.node.feed_id)) 21 xml.id(content_url(:page_path => item.node.feed_id))
22 xml.updated(item.updated_at.xmlschema) 22 xml.updated(item.updated_at.xmlschema)
23 xml.published(item.published_at.xmlschema) 23 xml.published(item.published_at.xmlschema)
24 xml.summary(CGI.escapeHTML(item.abstract.to_s)) 24 xml.summary(item.abstract.to_s)
25 xml.content(CGI.escapeHTML(item.body.to_s), :type => "html") 25 xml.content(item.body.to_s, :type => "html")
26 end 26 end
27 27
28 end 28 end