Project

General

Profile

Actions

Task #94797

closed

Bug #94787: Tracking issue related to HTML sanitization issues

Enhance documentation for integration of html-sanitizer

Added by Tomas Norre Mikkelsen over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
Security
Target version:
-
Start date:
2021-08-11
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
no-brainer
Sprint Focus:

Description

The example

class MyCustomBuilder extends DefaultSanitizerBuilder implements BuilderInterface
{
    public function createBehavior(): Behavior
    {
        // extends existing behavior, adds new tag
        return parent::createBehavior()
            ->withName('my-custom')
            ->withTags(
                (new Behavior\Tag('my-element', Behavior\Tag::ALLOW_CHILDREN))
                ->addAttrs(
                    (new Behavior\Attr('href'))->addValues(
                        new Behavior\RegExpAttrValue('#^(?:https?://|mailto:)#')
                    ),
                    ...$this->globalAttrs
                )
            );
        }
    }
}

from https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.5.x/Important-94484-IntroduceHTMLSanitizer.html

has one too many } in the example

Actions

Also available in: Atom PDF