Skip to content

Why twig extension are "HTML safe" by default ? #200

@lyrixx

Description

@lyrixx

I created a new twig extension with the maker bundle, and I saw that

    public function getFilters(): array
    {
        return [
            new TwigFilter('my_filter', [$this, 'doSomething'], ['is_safe' => ['html']]),
        ];
    }

IMHO, this should not be added because it's a major security issue.
If you really want to make things easy for new comer, it should be commented by default.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions