Skip to content

Commit 26fac73

Browse files
committed
Ref #9 - Add XSS test examples
1 parent 7f5d2ff commit 26fac73

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--TEST--
2+
Test a simple trans tag against XSS injection
3+
--TEMPLATE--
4+
{% trans %}<script>alert(1);</script>{% endtrans %}
5+
--DATA--
6+
return []
7+
--CONFIG--
8+
return []
9+
--EXPECT--
10+
<script>alert(1);</script>

test/Fixtures/TransFilterXss.test

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--TEST--
2+
Test a simple trans filter against XSS injection
3+
--TEMPLATE--
4+
{{ '<script>alert(1);</script>'|trans }}
5+
--DATA--
6+
return []
7+
--CONFIG--
8+
return []
9+
--EXPECT--
10+
&lt;script&gt;alert(1);&lt;/script&gt;

0 commit comments

Comments
 (0)