mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 09:57:25 +08:00
SECURITY: Prefer Loofah for processing cooked HTML
This commit is contained in:

committed by
Bianca Nenciu

parent
daf34ae7e2
commit
0c8d658ba8
@ -1809,4 +1809,12 @@ describe CookedPostProcessor do
|
||||
end
|
||||
end
|
||||
|
||||
context "#html" do
|
||||
it "escapes attributes" do
|
||||
post = Fabricate(:post, raw: '<img alt="<something>">')
|
||||
expect(post.cook(post.raw)).to eq('<p><img alt="<something>"></p>')
|
||||
expect(CookedPostProcessor.new(post).html).to eq('<p><img alt="<something>"></p>')
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user