PHPackages                             shieldon/web-security - 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. shieldon/web-security

ActiveLibrary[Security](/categories/security)

shieldon/web-security
=====================

XSS protection for PHP.

1.0.0(5y ago)326.4k↑25%1[1 issues](https://github.com/terrylinooo/web-security/issues)2MITPHPPHP &gt;=7.1.0CI failing

Since Jul 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/terrylinooo/web-security)[ Packagist](https://packagist.org/packages/shieldon/web-security)[ Docs](https://github.com/terrylinooo/web-security)[ RSS](/packages/shieldon-web-security/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (2)

Shieldon Web-Security
=====================

[](#shieldon-web-security)

[![Build Status](https://camo.githubusercontent.com/5b43d1110942db9889af6b2dcaedebc759ef7cddc916bbad63433ae363c57402/68747470733a2f2f7472617669732d63692e6f72672f74657272796c696e6f6f6f2f7765622d73656375726974792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/terrylinooo/web-security) [![codecov](https://camo.githubusercontent.com/4c1d8800445519645661d6e0bdfb5b3c90187bea404c91424730d339e5ae1c9e/68747470733a2f2f636f6465636f762e696f2f67682f74657272796c696e6f6f6f2f7765622d73656375726974792f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/terrylinooo/web-security) [![License: MIT](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://opensource.org/licenses/MIT)

This package is a part of [Shieldon Firewall 2](https://github.com/terrylinooo/shieldon).

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

[](#installation)

Use PHP Composer:

```
composer require shieldon/web-security
```

Or, download it and include the Shieldon autoloader.

```
require 'autoload.php';
```

Usage
-----

[](#usage)

#### Clean single variable

[](#clean-single-variable)

```
$xss = new \Shieldon\Security\Xss();

$_POST['username'] = 'javascript:/*-->';

$username = $xss->clean($_POST['username']);

echo $username;
```

result

```
[removed]/*--&gt;&lt;/title&gt;&lt;/style&gt;&lt;/textarea&gt;[removed]&lt;svg/[removed]&gt;

```

#### Clean a superglobal

[](#clean-a-superglobal)

```
$xss = new \Shieldon\Security\Xss();

$_GET = $xss->clean($_GET);
```

---

#### Author

[](#author)

- [Terry L.](https://terryl.in)

#### License

[](#license)

MIT

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity50

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

2127d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fca418a834057a4203c6856e316ca4d7c71fa1b9076977e08e5c4d5a9cc9aec6?d=identicon)[terrylinooo](/maintainers/terrylinooo)

---

Top Contributors

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

---

Tags

firewallweb-securityxss-protectionxss-filter

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shieldon-web-security/health.svg)

```
[![Health](https://phpackages.com/badges/shieldon-web-security/health.svg)](https://phpackages.com/packages/shieldon-web-security)
```

###  Alternatives

[shieldon/shieldon

Web application firewall for PHP.

87328.2k1](/packages/shieldon-shieldon)[pragmarx/firewall

A Laravel IP whitelisting and blacklisting

1.4k988.9k](/packages/pragmarx-firewall)[akaunting/laravel-firewall

Web Application Firewall (WAF) package for Laravel

999465.8k2](/packages/akaunting-laravel-firewall)[jeroenvisser101/leakybucket

An implementation of the Leaky Bucket algorithm.

44116.6k](/packages/jeroenvisser101-leakybucket)[bnomei/kirby3-redirects

Setup performant HTTP Status Code Redirects from within the Kirby Panel

269.1k](/packages/bnomei-kirby3-redirects)

PHPackages © 2026

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