Leave Alone
Leave Alone
Strip parentBut keep children in order', 'Non-whitelisted elements are stripped, but children are kept' ), array( 'p,strong', 'Keep
', 'Keep
', 'Non-whitelisted script elements are totally stripped, including any children' ), array( 'p[id]', 'Test
', 'Test
', 'Non-whitelisted attributes are stripped' ), array( 'p[default1=default1|default2=default2|force1:force1|force2:force2]', 'Test
', 'Test
', 'Default attributes are set when not present in input, forced attributes are always set' ) ); $config = HtmlEditorConfig::get('htmleditorsanitisertest'); foreach($tests as $test) { list($validElements, $input, $output, $desc) = $test; $config->setOptions(array('valid_elements' => $validElements)); $sanitiser = new HtmlEditorSanitiser($config); $htmlValue = Injector::inst()->create('HTMLValue', $input); $sanitiser->sanitise($htmlValue); $this->assertEquals($output, $htmlValue->getContent(), $desc); } } }