diff options
author | JoshyPHP <s9e.dev@gmail.com> | 2017-11-07 10:34:11 +0100 |
---|---|---|
committer | JoshyPHP <s9e.dev@gmail.com> | 2017-11-07 10:34:11 +0100 |
commit | 288def143cb8f594fd5c58d6a6dab07263a6c60e (patch) | |
tree | 758784f9c6cd8f4b8b0bd768f874b9450f145cc2 /tests/text_formatter/s9e/factory_test.php | |
parent | 44d5bde61604979ea6f89951e78edf352f8a9bb5 (diff) | |
download | forums-288def143cb8f594fd5c58d6a6dab07263a6c60e.tar forums-288def143cb8f594fd5c58d6a6dab07263a6c60e.tar.gz forums-288def143cb8f594fd5c58d6a6dab07263a6c60e.tar.bz2 forums-288def143cb8f594fd5c58d6a6dab07263a6c60e.tar.xz forums-288def143cb8f594fd5c58d6a6dab07263a6c60e.zip |
[ticket/15442] Allow unsafe HTML in bbcode.html
PHPBB3-15442
Diffstat (limited to 'tests/text_formatter/s9e/factory_test.php')
-rw-r--r-- | tests/text_formatter/s9e/factory_test.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/text_formatter/s9e/factory_test.php b/tests/text_formatter/s9e/factory_test.php index fd9b4e4c09..d35330a975 100644 --- a/tests/text_formatter/s9e/factory_test.php +++ b/tests/text_formatter/s9e/factory_test.php @@ -248,6 +248,22 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case } /** + * @testdox Accepts unsafe default BBCodes + */ + public function test_unsafe_default_bbcodes() + { + $fixture = __DIR__ . '/fixtures/unsafe_default_bbcodes.xml'; + $style_dir = __DIR__ . '/fixtures/styles/'; + $container = $this->get_test_case_helpers()->set_s9e_services(null, $fixture, $style_dir); + $parser = $container->get('text_formatter.parser'); + $renderer = $container->get('text_formatter.renderer'); + + $original = '[b]alert(1)[/b]'; + $expected = '<script>alert(1)</script>'; + $this->assertSame($expected, $renderer->render($parser->parse($original))); + } + + /** * @testdox get_configurator() triggers events before and after configuration */ public function test_configure_events() |