1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/15442] Allow unsafe HTML in bbcode.html

PHPBB3-15442
This commit is contained in:
JoshyPHP
2017-11-07 10:34:11 +01:00
parent 44d5bde616
commit 288def143c
4 changed files with 81 additions and 1 deletions

View File

@@ -247,6 +247,22 @@ class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case
$this->assertSame($expected, $renderer->render($parser->parse($original)));
}
/**
* @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
*/