diff --git a/package.json b/package.json index 658a65d8..e0bf0113 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Calvin Montgomery", "name": "CyTube", "description": "Online media synchronizer and chat", - "version": "3.38.1", + "version": "3.38.2", "repository": { "url": "http://github.com/calzoneman/sync" }, diff --git a/test/xss.js b/test/xss.js new file mode 100644 index 00000000..3fc20970 --- /dev/null +++ b/test/xss.js @@ -0,0 +1,12 @@ +const assert = require('assert'); +const XSS = require('../lib/xss'); + +describe('XSS', () => { + describe('sanitizeHTML', () => { + it('behaves consistently w.r.t. special chars used in emotes', () => { + const input = '`^~=| _-,;:!?/."()[]{}@$*\\&#%+á\t'; + const expected = '`^~=| _-,;:!?/."()[]{}@$*\\\\&#%+á\t'; + assert.strictEqual(XSS.sanitizeHTML(input), expected); + }); + }); +});