From 85b140ce9272c961f7383eeb701f15b1aed59104 Mon Sep 17 00:00:00 2001 From: Neil Jenkins Date: Mon, 15 Jun 2015 14:38:01 +0700 Subject: [PATCH 1/2] Fix tests. Fix up expected results for tests with the changed KEEP_CONTENT behaviour. Tests now all pass in latest Chrome, Firefox & Safari. --- test/expect.json | 116 ++++++++++++++++++++++++++--------------------- test/index.html | 4 +- 2 files changed, 66 insertions(+), 54 deletions(-) diff --git a/test/expect.json b/test/expect.json index a54bcf315..d8e303355 100644 --- a/test/expect.json +++ b/test/expect.json @@ -113,7 +113,7 @@ { "title": "mXSS Variation I", "payload": "<img onerror=\"alert(1);//\" src=1>", - "expected": "" + "expected": "<img onerror=\"alert(1);//\" src=1>" }, { "title": "mXSS Variation II", @@ -126,14 +126,18 @@ "expected": "" }, { - "title": "Img element inside nocript terminated inside comment", + "title": "Img element inside noscript terminated inside comment", "payload": "", "expected": ["", ""] }, { "title": "Img element inside noscript terminated inside attribute", "payload": "", - "expected": ["", "\">"] + "expected": [ + "\">", + "\">", + "" + ] }, { "title": "Img element inside shadow DOM template", @@ -156,7 +160,10 @@ { "title": "Iframe inside option element", "payload": "" ); assert.equal( DOMPurify.sanitize( '', {SAFE_FOR_JQUERY: false}), "" ); assert.equal( DOMPurify.sanitize( '', {SAFE_FOR_JQUERY: true}), "" ); - assert.equal( DOMPurify.sanitize( '