5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-10-06 22:46:57 +00:00

Merge branch 'usar-sutty-editor' into panel.sutty.nl
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
f 2023-02-01 17:55:32 -03:00
commit 5e53da764b
2 changed files with 4 additions and 4 deletions

View file

@ -24,7 +24,7 @@ class MetadataContent < MetadataTemplate
end end
def to_s def to_s
Nokogiri::HTML.fragment(value).tap do |html| Nokogiri::HTML5.fragment(value).tap do |html|
html.css('[src^="public/"]').each do |element| html.css('[src^="public/"]').each do |element|
element['src'] = convert_internal_path_to_src element['src'] element['src'] = convert_internal_path_to_src element['src']
end end
@ -46,7 +46,7 @@ class MetadataContent < MetadataTemplate
# TODO: En lugar de comprobar el Content Type acá, restringir los # TODO: En lugar de comprobar el Content Type acá, restringir los
# tipos de archivo a aceptar en ActiveStorage. # tipos de archivo a aceptar en ActiveStorage.
def sanitize(html_string) def sanitize(html_string)
html = Nokogiri::HTML.fragment(super html_string) html = Nokogiri::HTML5.fragment(super html_string)
elements = 'img,audio,video,iframe' elements = 'img,audio,video,iframe'
# Eliminar elementos sin src y comprobar su origen # Eliminar elementos sin src y comprobar su origen

View file

@ -1,11 +1,11 @@
# frozen_string_literal: true # frozen_string_literal: true
Rails.application.configure do Rails.application.configure do
next unless ENV['RAILS_ENV'] == 'development' next Rails.env.test?
domain = ENV.fetch('SUTTY', 'sutty.nl') domain = ENV.fetch('SUTTY', 'sutty.nl')
config.hosts << domain
config.hosts << "panel.#{domain}" config.hosts << "panel.#{domain}"
config.hosts << "api.#{domain}" config.hosts << "api.#{domain}"
config.hosts << /\Aapi\./
end end