PHPackages                             eyupcanakman/htmlawed - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. eyupcanakman/htmlawed

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

eyupcanakman/htmlawed
=====================

PHP 8.4+ compatible fork of vanilla/htmlawed — a composer wrapper for the htmLawed library to purify &amp; filter HTML.

v3.0.0(2mo ago)0226↓100%LGPL-3.0PHPPHP &gt;=8.1

Since Mar 7Pushed 2mo agoCompare

[ Source](https://github.com/eyupcanakman/htmlawed)[ Packagist](https://packagist.org/packages/eyupcanakman/htmlawed)[ RSS](/packages/eyupcanakman-htmlawed/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

htmlawed
========

[](#htmlawed)

PHP 8.4+ compatible fork of [vanilla/htmlawed](https://github.com/vanilla/htmlawed).

A composer wrapper for the [htmLawed](http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/) library to purify &amp; filter HTML.

Why this fork?
--------------

[](#why-this-fork)

The original `vanilla/htmlawed` (v2.2.15, Sep 2023) is unmaintained and triggers PHP 8.4 deprecation notices due to implicit nullable parameters. These deprecation notices produce output that breaks HTTP headers in API responses.

### Changes from vanilla/htmlawed v2.2.15

[](#changes-from-vanillahtmlawed-v2215)

- Added explicit nullable type hints to `Htmlawed::filter()` (`?array $config`, `string|array|null $spec`)
- Added parameter and return types to `Htmlawed::filter()` and `Htmlawed::filterRSS()`
- Bumped minimum PHP requirement to 8.1
- No changes to the htmLawed core library (`htmLawed.php`)

Installation
------------

[](#installation)

Requires PHP 8.1+.

```
composer require eyupcanakman/htmlawed
```

If you're migrating from `vanilla/htmlawed`:

```
composer require eyupcanakman/htmlawed
composer remove vanilla/htmlawed
```

Usage
-----

[](#usage)

```
echo Htmlawed::filter('Hello world!');
// Outputs: 'Hello world!'

echo Htmlawed::filter('nothing to seealert("xss")');
// Outputs: 'nothing to seealert("xss")'

// RSS filtering
echo Htmlawed::filterRSS('Hello world!');
// Outputs: 'Hello world!'
```

See the [htmLawed documentation](http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/htmLawed_README.htm#s2.2) for the full list of config and spec options.

Credits
-------

[](#credits)

- **Todd Burry / Vanilla Forums** — original [vanilla/htmlawed](https://github.com/vanilla/htmlawed) composer wrapper
- **Santosh Patnaik** — [htmLawed](http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/) core library

License
-------

[](#license)

LGPL-3.0 (same as the original package)

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance87

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

64d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/40c1e68364fcfad49a629d56d0ed1579991a026636dc8c306db0f18dbee85199?d=identicon)[eyupcanakman](/maintainers/eyupcanakman)

---

Top Contributors

[![eyupcanakman](https://avatars.githubusercontent.com/u/1732357?v=4)](https://github.com/eyupcanakman "eyupcanakman (1 commits)")

### Embed Badge

![Health badge](/badges/eyupcanakman-htmlawed/health.svg)

```
[![Health](https://phpackages.com/badges/eyupcanakman-htmlawed/health.svg)](https://phpackages.com/packages/eyupcanakman-htmlawed)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
