mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 15:28:41 +00:00
fix(web): prevent warning from HTMLPurifier
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
ref: http://htmlpurifier.org/docs/enduser-customize.html#optimized
This commit is contained in:
parent
054cb76481
commit
bae26f1c16
@ -167,9 +167,6 @@ class HTML {
|
||||
|
||||
public static function purifier() {
|
||||
$config = HTMLPurifier_Config::createDefault();
|
||||
// $config->set('Cache.DefinitionImpl', null);
|
||||
$config->set('HTML.DefinitionID', 'UOJ__HTML::purifier()');
|
||||
$config->set('HTML.DefinitionRev', 1);
|
||||
$config->set('Output.Newline', true);
|
||||
$def = $config->getHTMLDefinition(true);
|
||||
|
||||
@ -209,12 +206,10 @@ class HTML {
|
||||
'br' => [],
|
||||
'span' => ['data-realname' => 'Text', 'data-uoj-username' => 'Number'],
|
||||
];
|
||||
|
||||
$config = HTMLPurifier_Config::createDefault();
|
||||
|
||||
$allowed_elements = [];
|
||||
$allowed_attributes = [];
|
||||
|
||||
|
||||
foreach ($allowed_html as $element => $attributes) {
|
||||
$allowed_elements[$element] = true;
|
||||
foreach ($attributes as $attribute => $type) {
|
||||
@ -222,12 +217,9 @@ class HTML {
|
||||
}
|
||||
}
|
||||
|
||||
$config = HTMLPurifier_Config::createDefault();
|
||||
$config->set('HTML.AllowedElements', $allowed_elements);
|
||||
$config->set('HTML.AllowedAttributes', $allowed_attributes);
|
||||
|
||||
// $config->set('Cache.DefinitionImpl', null);
|
||||
$config->set('HTML.DefinitionID', 'UOJ__HTML::purifier_inline()');
|
||||
$config->set('HTML.DefinitionRev', 1);
|
||||
$def = $config->getHTMLDefinition(true);
|
||||
|
||||
foreach ($allowed_html as $element => $attributes) {
|
||||
|
Loading…
Reference in New Issue
Block a user