File tree Expand file tree Collapse file tree 1 file changed +31
-1
lines changed
app/code/Magento/Sales/Test/Unit/Helper Expand file tree Collapse file tree 1 file changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -354,7 +354,37 @@ public function escapeHtmlWithLinksDataProvider()
354
354
'<a>some text in tags</a> ' ,
355
355
'<a>some text in tags</a> ' ,
356
356
'allowedTags ' => ['a ' ]
357
- ]
357
+ ],
358
+ 'Not replacement with placeholders ' => [
359
+ "<a><script>alert(1)</script></a> " ,
360
+ '<a><script>alert(1)</script></a> ' ,
361
+ 'allowedTags ' => ['a ' ]
362
+ ],
363
+ 'Normal usage, url escaped ' => [
364
+ '<a href=\"#\">Foo</a> ' ,
365
+ '<a href="#">Foo</a> ' ,
366
+ 'allowedTags ' => ['a ' ]
367
+ ],
368
+ 'Normal usage, url not escaped ' => [
369
+ "<a href=http://example.com?foo=1&bar=2&baz[name]=BAZ>Foo</a> " ,
370
+ '<a href="http://example.com?foo=1&bar=2&baz[name]=BAZ">Foo</a> ' ,
371
+ 'allowedTags ' => ['a ' ]
372
+ ],
373
+ 'XSS test ' => [
374
+ "<a href= \"javascript:alert(59) \">Foo</a> " ,
375
+ '<a href="#">Foo</a> ' ,
376
+ 'allowedTags ' => ['a ' ]
377
+ ],
378
+ 'Additional regex test ' => [
379
+ "<a href= \"http://example1.com \" href= \"http://example2.com \">Foo</a> " ,
380
+ '<a href="http://example1.com">Foo</a> ' ,
381
+ 'allowedTags ' => ['a ' ]
382
+ ],
383
+ 'Break of valid urls ' => [
384
+ "<a href= \"http://example.com?foo=text with space \">Foo</a> " ,
385
+ '<a href="#">Foo</a> ' ,
386
+ 'allowedTags ' => ['a ' ]
387
+ ],
358
388
];
359
389
}
360
390
}
You can’t perform that action at this time.
0 commit comments