From 4f79a8042e0ee73fa6afb48a992c9c07d286d699 Mon Sep 17 00:00:00 2001 From: Patrick Steele-Idem Date: Fri, 1 Jul 2016 10:54:11 -0600 Subject: [PATCH] Fixes #322 - Autoescaping doesen't work in ' + * }; + * + * + * + * Without escaping the ending '' sequence the opening
{"name":"Evil </script>"}
\ No newline at end of file diff --git a/test/autotests/render/escape-script/template.marko b/test/autotests/render/escape-script/template.marko new file mode 100644 index 0000000000..f12f01aad7 --- /dev/null +++ b/test/autotests/render/escape-script/template.marko @@ -0,0 +1,4 @@ + +
${JSON.stringify(data.foo)}
\ No newline at end of file diff --git a/test/autotests/render/escape-script/test.js b/test/autotests/render/escape-script/test.js new file mode 100644 index 0000000000..e0035678a6 --- /dev/null +++ b/test/autotests/render/escape-script/test.js @@ -0,0 +1,5 @@ +exports.templateData = { + foo: { + name: 'Evil ' + } +}; diff --git a/test/autotests/render/script-tag-entities/expected.html b/test/autotests/render/script-tag-entities/expected.html index 91a5cf44b4..b0ca3c7a9c 100644 --- a/test/autotests/render/script-tag-entities/expected.html +++ b/test/autotests/render/script-tag-entities/expected.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/test/autotests/render/script-tag-entities/test.js b/test/autotests/render/script-tag-entities/test.js index d7f36b92c1..4221021f44 100644 --- a/test/autotests/render/script-tag-entities/test.js +++ b/test/autotests/render/script-tag-entities/test.js @@ -1,3 +1,3 @@ exports.templateData = { - "name": "" };