From 536646a13c008b2ebcee8a4f25e7c011a8eb4a8b Mon Sep 17 00:00:00 2001 From: erdgeist Date: Fri, 26 Jun 2026 14:22:33 +0200 Subject: Fix RSS feeds, xmlparser initializer --- app/controllers/pages_controller.rb | 12 +++++------- config/initializers/xmlparser.rb | 9 +++++++-- 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 # Private before_action :login_required - + def preview @page = Page.find(params[:id]) - + if @page template = @page.valid_template render( - :file => template, - :layout => "application" + template: template, + layout: "application" ) end - end - - + def sort_images page = Page.find(params[:id]) 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 @@ class XML::Node - def replace_with(other) + def replace_with(other) self.next = other remove! end end +# Builder 3.x escapes content by default. Override _escape to pass text +# through raw, preserving existing behaviour from the Rails 2 era. +# Note: require builder first to ensure XmlBase < BasicObject is already +# defined before we reopen it. +require 'builder' module Builder class XmlBase def _escape(text) text end end -end \ No newline at end of file +end -- cgit v1.3