escape json for use in js
This commit is contained in:
committed by
Noraiz Anwar
parent
8df5b58853
commit
e0d19d6871
@@ -1466,7 +1466,7 @@ class JsonInitDataTest(ModuleStoreTestCase):
|
||||
|
||||
@ddt.data(
|
||||
({'a': 17}, '''{"a": 17}'''),
|
||||
({'xss': '</script>alert("XSS")'}, r'''{"xss": "<\/script>alert(\"XSS\")"}'''),
|
||||
({'xss': '</script>alert("XSS")'}, r'''{"xss": "\u003c/script\u003ealert(\"XSS\")"}'''),
|
||||
)
|
||||
@ddt.unpack
|
||||
@XBlock.register_temp_plugin(XBlockWithJsonInitData, identifier='withjson')
|
||||
|
||||
Reference in New Issue
Block a user