1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-30 19:00:10 +02:00

Add contenteditable attribute definition (#332)

* Add contenteditable attribute definition

* gate behind html.trusted

* use enum
This commit is contained in:
Kieran
2022-09-06 18:04:45 +01:00
committed by GitHub
parent 1c2bae18e3
commit dbbd3e59f9
3 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
<?php
class HTMLPurifier_AttrDef_HTML_ContentEditableTest extends HTMLPurifier_AttrDefHarness
{
public function setUp()
{
parent::setUp();
$this->def = new HTMLPurifier_AttrDef_HTML_ContentEditable();
}
public function test()
{
$this->assertDef('', false);
$this->assertDef('true', false);
$this->assertDef('caret', false);
$this->assertDef('false');
}
public function testTrustedHtml()
{
$this->config->set('HTML.Trusted', true);
$this->assertDef('');
$this->assertDef('true');
$this->assertDef('false');
$this->assertDef('caret', false);
}
}