PHPackages                             devtoolboxuk/soteria - 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. devtoolboxuk/soteria

ActiveLibrary[Security](/categories/security)

devtoolboxuk/soteria
====================

Security Package for PHP

2.1.11(6y ago)05.6k1MITPHPPHP &gt;=5.4.16

Since Feb 11Pushed 6y ago2 watchersCompare

[ Source](https://github.com/devtoolboxuk/soteria)[ Packagist](https://packagist.org/packages/devtoolboxuk/soteria)[ RSS](/packages/devtoolboxuk-soteria/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (3)Versions (26)Used By (1)

soteria
=======

[](#soteria)

[![Build Status](https://camo.githubusercontent.com/89861ec9af8bb46132b83d2b61e2580c3bee5362a457eb282dfda155c8cf6ae7/68747470733a2f2f6170692e7472617669732d63692e6f72672f646576746f6f6c626f78756b2f736f74657269612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/devtoolboxuk/soteria)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/62b4b57c14a417e13537f9b837ea22a44a20751da8c2fd1ec0c0c3ba77c8eb85/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f646576746f6f6c626f78756b2f736f74657269612f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/devtoolboxuk/soteria/?branch=master)[![Coveralls](https://camo.githubusercontent.com/74a82ae5c212066ecb8f97fec138bd537e04d6b296ce5d892de8376c00c8b421/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f646576746f6f6c626f78756b2f736f74657269612f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/devtoolboxuk/soteria?branch=master)[![CodeCov](https://camo.githubusercontent.com/22f258d10daa0ad3f721a68a644391d8c7b44b736c5801cf1561fac800511032/68747470733a2f2f636f6465636f762e696f2f67682f646576746f6f6c626f78756b2f736f74657269612f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/devtoolboxuk/soteria)

[![Latest Stable Version](https://camo.githubusercontent.com/f7f32f259ff363592ff47fef07737937acaa1b0fc1122e56115722134178b833/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646576746f6f6c626f78756b2f736f74657269612e7376673f7374796c653d706c6173746963)](https://packagist.org/packages/devtoolboxuk/soteria)[![Total Downloads](https://camo.githubusercontent.com/63ed851897ffc914efe09efde1eb888b7bc556eec7ad4e646c36986fa7913283/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646576746f6f6c626f78756b2f736f74657269612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devtoolboxuk/soteria)[![License](https://camo.githubusercontent.com/10217b4860be5e3c52534dfaa34f25b142eb0ad29bff52f456b08023fe3db7a3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f646576746f6f6c626f78756b2f736f74657269612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/devtoolboxuk/soteria)

Table of Contents
-----------------

[](#table-of-contents)

- [Background](#Background)
- [Usage](#Usage)
- [Maintainers](#Maintainers)
- [License](#License)

Background
----------

[](#background)

Various security libraries rolled into one place.

The XSS cleaner is a port from  with the ability for it to work on some older systems.

When I get around to upgrading my legacy systems, the XSS cleaner will be updated to use voku/anti-xss directly (because it's awesome)

I've also added a URL decoder, as I found some items causing a few issues with invisible characters such as \\r\\n (in a URL, you probably wouldn't want this)

Usage
-----

[](#usage)

```
$ composer require devtoolboxuk/soteria
```

Then include Composer's generated vendor/autoload.php to enable autoloading:

```
require 'vendor/autoload.php';
```

```
use devtoolboxuk\soteria;

$this->security = new SoteriaService();
```

XSS
---

[](#xss)

```
$xss = $this->security->xss();
```

#### XSS Clean

[](#xss-clean)

Great for clearing out data in posted data

```
#$data can be either a string or an array
$xss->clean($data); //Outputs data that has had XSS data removed.
```

#### XSS Detected

[](#xss-detected)

```
$xss->clean($data);
$xss->isXssFound(); //Returns true / false
```

#### XSS Clean a URL

[](#xss-clean-a-url)

Great for clearing out crappy URLs (does the same as clean, but also removes invisible characters like \\r \\n)

```
#$data can be either a string or an array
$xss->cleanUrl($data); //Outputs data that has had XSS data removed.
```

#### XSS Detected

[](#xss-detected-1)

```
$xss->cleanUrl($data);
$xss->isXssFound(); //Returns true / false
```

Filter
------

[](#filter)

```
$filter = $this->security->filter();
```

#### Filter Email

[](#filter-email)

```
$filter->email('test@local.com');
```

#### Filter Was an invalid email address used

[](#filter-was-an-invalid-email-address-used)

```
$filter->email('test@local.com');
$filter->isValid(); //Returns true / false
```

Maintainers
-----------

[](#maintainers)

[@DevToolboxUk](https://github.com/DevToolBoxUk).

License
-------

[](#license)

[MIT](LICENSE) © DevToolboxUK

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Every ~10 days

Recently: every ~26 days

Total

25

Last Release

2410d ago

Major Versions

1.1.1 → 2.0.02019-05-10

### Community

Maintainers

![](https://www.gravatar.com/avatar/11e7828108a460ad0b3dc92c08fa9e0e863168b8dae2b4d7041a6d699f936faa?d=identicon)[devtoolboxuk](/maintainers/devtoolboxuk)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/devtoolboxuk-soteria/health.svg)

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

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

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

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)

PHPackages © 2026

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