Start working on text sanitizer
This commit is contained in:
parent
1c3273978b
commit
2e8f31ae2b
2 changed files with 14 additions and 3 deletions
|
|
@ -8,8 +8,8 @@ function basicTest() {
|
|||
assert(sanitize("< img src=asdf onerror='alert(\"xss\")'>") ===
|
||||
"<img src=\"asdf\">");
|
||||
|
||||
assert(sanitize("<a href='javascript:alert(document.cookie)'>") ===
|
||||
"<a href=\":()\">");
|
||||
assert(sanitize("<a href='javascript:alert(document.cookie)'>") ===
|
||||
"<a href=\"[removed]:[removed]([removed])\">");
|
||||
|
||||
assert(sanitize("<a ") === "<a>");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue