Skip to content

Replace HTMLPurifier with a maintained dependency #7916

@asmecher

Description

@asmecher

HTMLPurifier is not maintained anymore. Find another replacement toolset for "safe" HTML filtering.

It does not support HTML5: https://forum.pkp.sfu.ca/t/tinymce-stripping-anchor-tags-within-or-around-divs/72749/12

We currently use HTMLPurifier in the PKPString::stripUnsafeHtml function (lib/pkp/classes/core/PKPString.inc.php). This takes a configuration of allowed elements/attributes from config.inc.php.

PRs
pkp-lib --> #9257
ojs --> pkp/ojs#4025 [TEST ONLY]
omp --> pkp/omp#1581 [TEST ONLY]
ops --> pkp/ops#696 [TEST ONLY]
jatsTemplate --> pkp/jatsTemplate#30
oaiJats --> pkp/oaiJats#36

Update
Based on following reasons we have decided to revert back the Symfony HTML Sanitizer and keep using the HTMLPurifier

Reverting Back HTMLPurifier
pkp-lib --> #10197
ojs --> pkp/ojs#4365 [TEST ONLY]
omp --> pkp/omp#1634 [TEST ONLY]
ops --> pkp/ops#729 [TEST ONLY]
jatsTemplate --> pkp/jatsTemplate#46
oaiJats --> pkp/oaiJats#46

Metadata

Metadata

Labels

Housekeeping:1:TodoAny dependency management or refactor that would be nice to have some day.

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions