Skip to content

Commit

Permalink
Remove unnecessary sanitising
Browse files Browse the repository at this point in the history
Existing descriptions have been sanitised in a migration. New
descriptions are sanitised when assigned. That should cover everything.
  • Loading branch information
mkllnk committed Sep 5, 2024
1 parent 53286c2 commit d061fe8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
5 changes: 0 additions & 5 deletions app/models/enterprise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,6 @@ def self.distinct_count
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))
Expand Down
5 changes: 0 additions & 5 deletions spec/models/enterprise_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,6 @@
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
Expand Down

0 comments on commit d061fe8

Please sign in to comment.