mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
added sane sanitizer (Google Cajole) that is much more robust than old one ... yay for smilies
added sane way to do $LAB includes - pattern to be expanded people keep on messing structure.sql
This commit is contained in:
19
spec/javascripts/sanitize_spec.js
Normal file
19
spec/javascripts/sanitize_spec.js
Normal file
@ -0,0 +1,19 @@
|
||||
describe("sanitize", function(){
|
||||
|
||||
|
||||
it("strips all script tags", function(){
|
||||
sanitized = sanitizeHtml("<div><script>alert('hi');</script></div>");
|
||||
|
||||
expect(sanitized)
|
||||
.toBe("<div></div>");
|
||||
});
|
||||
|
||||
it("strips disallowed attributes", function(){
|
||||
sanitized = sanitizeHtml("<div><p class=\"funky\" wrong='1'>hello</p></div>");
|
||||
|
||||
expect(sanitized)
|
||||
.toBe("<div><p class=\"funky\">hello</p></div>");
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user