diff --git a/app/models/concerns/sanitize_concern.rb b/app/models/concerns/sanitize_concern.rb index 5ef9476..d0c647a 100644 --- a/app/models/concerns/sanitize_concern.rb +++ b/app/models/concerns/sanitize_concern.rb @@ -17,8 +17,8 @@ def sanitize_pdf(pdf_string) ActionController::Base.helpers.sanitize( pdf_string, - tags: Loofah::HTML5::WhiteList::ACCEPTABLE_ELEMENTS.add('style'), - attributes: Loofah::HTML5::WhiteList::ACCEPTABLE_ATTRIBUTES + tags: Loofah::HTML5::SafeList::ACCEPTABLE_ELEMENTS.dup.delete("select").merge(['style', 'title']), + attributes: Loofah::HTML5::SafeList::ACCEPTABLE_ATTRIBUTES ) end end diff --git a/spec/models/concerns/sanitize_concern_spec.rb b/spec/models/concerns/sanitize_concern_spec.rb index 90d7789..d78ce49 100644 --- a/spec/models/concerns/sanitize_concern_spec.rb +++ b/spec/models/concerns/sanitize_concern_spec.rb @@ -11,7 +11,8 @@ class FakeConcernTestClass context 'when the value is a string' do context 'when the value contains img tag' do let(:body) do - "

Uqhp Eligible Document for {{ family_reference.hbx_id }} @@ -20,6 +21,7 @@ class FakeConcernTestClass it 'should include whitelisted tags' do expect(subject.sanitize_pdf(body)).to include('