ezyang/htmlpurifier
Standards compliant HTML filter written in PHP
v4.19.0
368M downloads/mo
#156 most downloaded on composer
ezyang/htmlpurifier
What this package is like to depend on
Last release 10 months ago
17 Oct 2025
Ships fairly regularly
a new release about every 9 months
Rarely documented
notes for 4 of 17 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
17 releases · first in 2013
1 release in the last 12 months
see the full history below
Release timeline
17 releases · Feb 2013 to Oct 2025Releases
latest 17-
v4.19.017 Oct 2025Release notes
Open source →4.19.0 (2025-10-17)
Bug Fixes
- add warning for misleading option (#433) (b21a591)
- catastrophic backtracking in Core.AggressivelyFixLt (#440) (418eeb7)
- Deprecated: preg_replace(): Passing null to parameter #3 ($subject) o… (#421) (5d154a2)
- non-substantive typos (#434) (c2bc354)
Features
-
v4.18.001 Nov 2024Release notes
Open source →4.18.0 (2024-11-01)
Bug Fixes
- Adjust Core.AllowHostnameUnderscore to consider that "_" is defined as Unreserved Characters in RFC 3986 (#406) (d9fbef8)
- Avoid a deprecated error when the attribute name is numeric and DirectLex is used (#412) (f0fbf51)
- checking that node has property name (#399) (9ca5a36)
- Ignore conditional comments (#401) (4828fdf)
- Support PHP 8.4 (#396) (92da247)
- undefined array key warning (#419) (01be377)
Features
Release notes
Open source →Bug Fixes
- Adjust Core.AllowHostnameUnderscore to consider that "_" is defined as Unreserved Characters in RFC 3986 (#406) (d9fbef8)
- Avoid a deprecated error when the attribute name is numeric and DirectLex is used (#412) (f0fbf51)
- checking that node has property name (#399) (9ca5a36)
- Ignore conditional comments (#401) (4828fdf)
- Support PHP 8.4 (#396) (92da247)
- undefined array key warning (#419) (01be377)
Features
-
v4.17.017 Nov 2023Release notes
Open source →4.17.0 (2023-11-17)
Bug Fixes
- CSSTidy ImportantComments not handled properly (#359) (78a9b4d)
- fix CI (#361) (9ec687c)
- Invalid scheme check in Attr.TargetBlank (#363) (0176ef4)
- semantic release (#339) (d82f3d9)
- semantic release (#341) (e55fead), closes #339
- Support for locales using decimal separators other than . (dot) (#372) (43f49ac)
Features
- Add support for all text-decoration properties (#360) (2d775c0)
- Allows commas to be included in tel URI (#389) (ec92490), closes #388
Reverts
Release notes
Open source →Bug Fixes
- CSSTidy ImportantComments not handled properly (#359) (78a9b4d)
- fix CI (#361) (9ec687c)
- Invalid scheme check in Attr.TargetBlank (#363) (0176ef4)
- semantic release (#339) (d82f3d9)
- semantic release (#341) (e55fead), closes #339
- Support for locales using decimal separators other than . (dot) (#372) (43f49ac)
Features
- Add support for all text-decoration properties (#360) (2d775c0)
- Allows commas to be included in tel URI (#389) (ec92490), closes #388
Reverts
NEWS ( CHANGELOG and HISTORY ) HTMLPurifier |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
= KEY ==================== # Breaks back-compat ! Feature - Bugfix + Sub-comment . Internal change
4.15.0, released 2022-09-18 ! PHP 8.1 and 8.2 support, esp. fixes for deprecation warnings. A joint effort by David Rans, Tim Düsterhus, Kieran and John Flatness. ! Allow contenteditable="false" (#336), contributed by Kieran.
- Replace PHP 8.1 deprecated utf8_ functions with mbstring (#326), contributed by John Flatness.
- Enhanced composer suggestions with extensions (#317), contributed by func0der.
4.14.0, released 2021-12-24 ! Add "background-size" support (#289), contributed by Václav Smítal ! Transform deprecated width attribute when tidying HTML, contributed by Kieran.
- PHP 8 support, contributed by Maksims Sļotovs.
- Improved PHP 7.3 compatibility, contributed by kishor.
- Avoid spurious magic quotes notice in PHP 7.4. Thanks Jasper Zonneveld for the fix.
- Do not remove thead from table even if there are no tbody/tr (#264). Thanks Marcus Artner for the fix.
- Fix "Parameter must be an array or an object that implements Countable" (#285)". Thanks Kieran for this fix. . Fix unnecessary reference assignment, handling behavior change from PHP5 and PHP7. Thanks Arkadiusz Biczewski for the fix.
4.13.0, released 2020-06-28 ! Add %HTML.Forms directive, which lets you accept forms in user HTML without requiring full %HTML.Trusted. Note that forms can be (trivially) used to setup phishing; e.g., an attacker can use CSS absolute positioning to overlay a form on top of a login element, so please be sure to use this with care! Fixes #213. Thanks Mateusz Turcza for contributing this feature. ! tr@bgcolor attribute is now supported. Thanks Kieran Brahney for this enhancement.
- Further improvements to PHP 7.4 support, contributed by Witold Wasiczko and Eloy Lafuente.
- Fix PSR-0 compatibility. Thanks Jordi Boggiano for contributing part of this fix.
- Fix bug with purifyArray where it doesn't work on empty arrays. Thanks Fräntz Miccoli for the fix.
- Reduce amount of maintenance scripts included in distribution packages. Thanks Sergei Morozov for this patch.
- Remove leading zeros unless if it is only a zero, fixes #239. Thanks lubomirbartos for this fix.
- Correct type hinting of maybeGet*, fixes #240. Thanks Anders Jenbo for this fix.
4.12.0, released 2019-10-27 ! PHP 7.4 is supported, thank you Witold Wasiczko, Mateuz Turcza and Edi Modrić
- PHPDocs for HTMLModule::addElement() and Bool attr are fixed (thanks Mateusz)
4.11.0, released 2019-07-14
-
v4.16.018 Sep 2022 -
v4.15.018 Sep 2022Nothing published for this version
-
v4.14.025 Dec 2021Nothing published for this version
-
v4.13.029 Jun 2020Nothing published for this version
-
v4.12.028 Oct 2019Nothing published for this version
-
v4.11.014 Jul 2019Nothing published for this version
-
v4.10.023 Feb 2018Nothing published for this version
-
v4.9.303 Jun 2017Nothing published for this version
-
v4.9.213 Mar 2017Nothing published for this version
-
v4.9.108 Mar 2017Nothing published for this version
-
v4.8.016 Jul 2016Nothing published for this version
-
v4.7.005 Aug 2015Nothing published for this version
-
v4.6.030 Nov 2013Nothing published for this version
-
v4.5.018 Feb 2013Nothing published for this version