We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7c717dc + 95e89ce commit 615b143Copy full SHA for 615b143
1 file changed
tests/IssuesTest.php
@@ -0,0 +1,29 @@
1
+<?php
2
+/**
3
+ * @author Todd Burry <todd@vanillaforums.com>
4
+ * @copyright 2009-2016 Vanilla Forums Inc.
5
+ * @license Proprietary
6
+ */
7
+
8
+namespace Htmlawed\Tests;
9
10
+use Htmlawed;
11
12
13
+ * Test issues that come up on Github.
14
15
+class IssuesTest extends \PHPUnit_Framework_TestCase {
16
+ /**
17
+ * Test overly aggressive span stripping.
18
+ *
19
+ * @link https://github.com/vanilla/htmlawed/issues/1
20
21
+ public function testAggressiveSpanStripping() {
22
+ $html = '<span style="expression(alert(\'XSS\')">foo</span>';
23
+ $expected = 'foo';
24
25
+ $config = ['deny_attribute' => 'on*,style'] + Htmlawed::$defaultConfig;
26
+ $filtered = Htmlawed::filter($html, $config);
27
+ $this->assertSame($expected, $filtered);
28
+ }
29
+}
0 commit comments