From 4b6496c5452c3f635262394e29c79c05ddd0ac70 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 20 Jul 2017 15:58:03 +0200 Subject: [PATCH] Do html cleanup directly on content fields too (not only on finished article). --- app/models/signature.rb | 4 ++++ app/models/text_module.rb | 3 +++ 2 files changed, 7 insertions(+) diff --git a/app/models/signature.rb b/app/models/signature.rb index 0435e0fff..04053bad0 100644 --- a/app/models/signature.rb +++ b/app/models/signature.rb @@ -2,7 +2,11 @@ class Signature < ApplicationModel include ChecksLatestChangeObserved + include ChecksHtmlSanitized has_many :groups, after_add: :cache_update, after_remove: :cache_update validates :name, presence: true + + sanitized_html :body + end diff --git a/app/models/text_module.rb b/app/models/text_module.rb index 357f0c78b..7fcb7da83 100644 --- a/app/models/text_module.rb +++ b/app/models/text_module.rb @@ -2,10 +2,13 @@ class TextModule < ApplicationModel include ChecksClientNotification + include ChecksHtmlSanitized validates :name, presence: true validates :content, presence: true + sanitized_html :content + =begin load text modules from online