Skip to content

Commit

Permalink
unit test for issue #20
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Boutell committed Jul 18, 2014
1 parent f7aa27c commit ef163ce
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,19 @@ describe('sanitizeHtml', function() {
''
);
});
it('should not allow a naked = sign followed by an unrelated attribute to result in one merged attribute with unescaped double quote marks', function() {
assert.equal(
sanitizeHtml(
'<IMG SRC= onmouseover="alert(\'XSS\');">',
{
allowedTags: [ 'img' ],
allowedAttributes: {
img: [ 'src' ]
}
}
),
'<img src="" />'
);
});
});

0 comments on commit ef163ce

Please sign in to comment.