summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-06-26 14:22:33 +0200
committererdgeist <erdgeist@erdgeist.org>2026-06-26 14:22:33 +0200
commit536646a13c008b2ebcee8a4f25e7c011a8eb4a8b (patch)
treec4648f632faf18d14f3b79fdf32e9623d43afd6e
parent811bb04649365b0faaa00b1e0810bb101a4d19b1 (diff)
Fix RSS feeds, xmlparser initializer
-rw-r--r--app/controllers/pages_controller.rb12
-rw-r--r--config/initializers/xmlparser.rb9
2 files changed, 12 insertions, 9 deletions
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb
index a40bf10..2d08dea 100644
--- a/app/controllers/pages_controller.rb
+++ b/app/controllers/pages_controller.rb
@@ -3,21 +3,19 @@ class PagesController < ApplicationController
3 # Private 3 # Private
4 4
5 before_action :login_required 5 before_action :login_required
6 6
7 def preview 7 def preview
8 @page = Page.find(params[:id]) 8 @page = Page.find(params[:id])
9 9
10 if @page 10 if @page
11 template = @page.valid_template 11 template = @page.valid_template
12 render( 12 render(
13 :file => template, 13 template: template,
14 :layout => "application" 14 layout: "application"
15 ) 15 )
16 end 16 end
17
18 end 17 end
19 18
20
21 def sort_images 19 def sort_images
22 page = Page.find(params[:id]) 20 page = Page.find(params[:id])
23 page.update_assets(params[:images]) 21 page.update_assets(params[:images])
diff --git a/config/initializers/xmlparser.rb b/config/initializers/xmlparser.rb
index 9c3f1c8..1d5e06d 100644
--- a/config/initializers/xmlparser.rb
+++ b/config/initializers/xmlparser.rb
@@ -1,14 +1,19 @@
1class XML::Node 1class XML::Node
2 def replace_with(other) 2 def replace_with(other)
3 self.next = other 3 self.next = other
4 remove! 4 remove!
5 end 5 end
6end 6end
7 7
8# Builder 3.x escapes content by default. Override _escape to pass text
9# through raw, preserving existing behaviour from the Rails 2 era.
10# Note: require builder first to ensure XmlBase < BasicObject is already
11# defined before we reopen it.
12require 'builder'
8module Builder 13module Builder
9 class XmlBase 14 class XmlBase
10 def _escape(text) 15 def _escape(text)
11 text 16 text
12 end 17 end
13 end 18 end
14end \ No newline at end of file 19end