ezyang/htmlpurifier

Standards compliant HTML filter written in PHP

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 1 hour ago
Added to GitGenius on September 20th, 2026
Created on June 24th, 2008
Open Issues & Pull Requests: 131 (+0)
GitHub issues: Enabled
Number of forks: 361
Total Stargazers: 3,354 (+0)
Total Subscribers: 56 (+0)

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 23
New in 7 days: 0
Closed in 7 days: 2
Avg open age: 1,016 days
Stale 30+ days: 23
Stale 90+ days: 23

Recent activity

Opened in 7 days: 0
Closed in 7 days: 2
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • released (4)

Detailed Description

HTML Purifier is a standards compliant HTML filter written in PHP.

HTML Purifier solves the problem of sanitizing untrusted HTML input while preserving safe content. It parses HTML according to web standards and removes potentially dangerous elements, attributes, and protocols while maintaining the structure and formatting of legitimate markup. The tool uses a whitelist-based approach, allowing only explicitly permitted tags and attributes through to the output.

Developers should choose HTML Purifier when building applications that accept user-generated HTML content, such as comment systems, rich text editors, or content management platforms. It is particularly suited for projects where security cannot be compromised and standards compliance matters. The tool works well in PHP applications where server-side sanitization is the appropriate defense layer.

The project maintains steady activity with regular updates addressing edge cases and standards compliance. Development focuses on correctness and adherence to HTML specifications rather than feature expansion. The codebase receives ongoing maintenance to handle newly discovered attack vectors and evolving HTML standards.