PHPackages                             artyomnar/output-purifier - 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. [Security](/categories/security)
4. /
5. artyomnar/output-purifier

ActiveLibrary[Security](/categories/security)

artyomnar/output-purifier
=========================

Purifies text from unnecessary tags, external-sources and scripts

v1.0(4y ago)171MITPHPPHP &gt;=8.0

Since Dec 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/artyomnar94/output-purifier)[ Packagist](https://packagist.org/packages/artyomnar/output-purifier)[ RSS](/packages/artyomnar-output-purifier/feed)WikiDiscussions main Synced today

READMEChangelog (1)DependenciesVersions (2)Used By (0)

output-purifier
===============

[](#output-purifier)

Purifies text from unnecessary tags, external-sources and scripts

[![Latest Stable Version](https://camo.githubusercontent.com/4c8825c4d2a3cfe03b2a32099d7084769c0ee428637dd45ec236ef75974f48ac/68747470733a2f2f706f7365722e707567782e6f72672f617274796f6d6e61722f6f75747075742d70757269666965722f762f737461626c652e706e67)](https://packagist.org/packages/artyomnar/output-purifie)[![Total Downloads](https://camo.githubusercontent.com/660f0f49b38f3e43c499de104fae197c1cd526baa64575d16e0f065a3d989984/68747470733a2f2f706f7365722e707567782e6f72672f617274796f6d6e61722f6f75747075742d70757269666965722f646f776e6c6f6164732e706e67)](https://packagist.org/packages/artyomnar/output-purifier)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require artyomnar/output-purifier

```

or add

```
"artyomnar/output-purifier": "*"

```

to the require section of your composer.json.

Usage
-----

[](#usage)

### Saving filtered text into DB:

[](#saving-filtered-text-into-db)

```
$rawText = 'Hello, world!Go!';
$purifier = Purifier::getInstance(['img', 'a', 'p'], ['https://mysite.com'], '#');
$db->save($purifier->filter($rawText));

//Result:Hello, world!Go!

```

### Displaying filtered text on view:

[](#displaying-filtered-text-on-view)

```
$rawText = 'Hello, world!Go to the link https://xxx.com ';
$purifier = Purifier::getInstance(['img', 'a', 'p', 'div'], ['https://mysite.com', 'https://static.mysite.com'], 'https://valid-site.com');
echo $purifier->filter($rawText);

//Result:hello, world!Go to the link https://valid-site.com

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

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

1596d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e2d7d8dfec8a847c5f939d4a921d69eddddf0e126aaddda2899191462963dd1?d=identicon)[artyomnar94](/maintainers/artyomnar94)

---

Top Contributors

[![artyomnar94](https://avatars.githubusercontent.com/u/57597170?v=4)](https://github.com/artyomnar94 "artyomnar94 (3 commits)")

---

Tags

securityxsspurifyfilteringanti-xssquotingprevent-xss

### Embed Badge

![Health badge](/badges/artyomnar-output-purifier/health.svg)

```
[![Health](https://phpackages.com/badges/artyomnar-output-purifier/health.svg)](https://phpackages.com/packages/artyomnar-output-purifier)
```

###  Alternatives

[voku/anti-xss

anti xss-library

72317.1M76](/packages/voku-anti-xss)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M112](/packages/mews-purifier)[akaunting/laravel-firewall

Web Application Firewall (WAF) package for Laravel

999465.8k2](/packages/akaunting-laravel-firewall)[luketowers/purifier

Laravel 5 HtmlPurifier Package

3280.0k9](/packages/luketowers-purifier)

PHPackages © 2026

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