Skip to content

Commit 13c5b03

Browse files
committed
Migrate from HTMLPurifier to html-sanitizer
1 parent 0a99a78 commit 13c5b03

File tree

6 files changed

+255
-53
lines changed

6 files changed

+255
-53
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"doctrine/doctrine-migrations-bundle": "^1.3",
1111
"doctrine/orm": "^2.5.11",
1212
"erusev/parsedown": "^1.6",
13-
"ezyang/htmlpurifier": "^4.9",
1413
"sensio/framework-extra-bundle": "^5.1",
1514
"sensiolabs/security-checker": "^5.0",
1615
"symfony/asset": "*",
@@ -29,6 +28,7 @@
2928
"symfony/validator": "*",
3029
"symfony/webpack-encore-bundle": "^1.1",
3130
"symfony/yaml": "*",
31+
"tgalopin/html-sanitizer-bundle": "^1.1",
3232
"twig/extensions": "^1.5",
3333
"twig/twig": "^2.6",
3434
"white-october/pagerfanta-bundle": "^1.1"

composer.lock

+214-41
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/bundles.php

+1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@
1717
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
1818
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true],
1919
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
20+
HtmlSanitizer\Bundle\HtmlSanitizerBundle::class => ['all' => true],
2021
];

config/packages/html_sanitizer.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
html_sanitizer:
2+
default_sanitizer: 'default'
3+
sanitizers:
4+
default:
5+
# Read https://github.com/tgalopin/html-sanitizer/blob/master/docs/1-getting-started.md#extensions
6+
# to learn more about which extensions you would like to enable.
7+
extensions:
8+
- 'basic'
9+
- 'list'
10+
- 'table'
11+
- 'image'
12+
- 'code'
13+
14+
# Read https://github.com/tgalopin/html-sanitizer/blob/master/docs/3-configuration-reference.md
15+
# to discover all the available options for each extension.

0 commit comments

Comments
 (0)