mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Remove unnecessary sanitising
Existing descriptions have been sanitised in a migration. New descriptions are sanitised when assigned. That should cover everything.
This commit is contained in:
@@ -247,11 +247,6 @@ class Enterprise < ApplicationRecord
|
||||
count(distinct: true)
|
||||
end
|
||||
|
||||
# Remove any unsupported HTML.
|
||||
def long_description
|
||||
HtmlSanitizer.sanitize(super)
|
||||
end
|
||||
|
||||
# Remove any unsupported HTML.
|
||||
def long_description=(html)
|
||||
super(HtmlSanitizer.sanitize(html))
|
||||
|
||||
@@ -404,11 +404,6 @@ RSpec.describe Enterprise do
|
||||
subject.long_description = "Hello <script>alert</script> dearest <b>monster</b>."
|
||||
expect(subject.long_description).to eq "Hello alert dearest <b>monster</b>."
|
||||
end
|
||||
|
||||
it "sanitises existing HTML in long_description" do
|
||||
subject[:long_description] = "Hello <script>alert</script> dearest <b>monster</b>."
|
||||
expect(subject.long_description).to eq "Hello alert dearest <b>monster</b>."
|
||||
end
|
||||
end
|
||||
|
||||
describe "callbacks" do
|
||||
|
||||
Reference in New Issue
Block a user