PHPackages                             ggiallo28/banbuilder - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ggiallo28/banbuilder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ggiallo28/banbuilder
====================

Library to easily handle profanity filtering in PHP projects.

2.2.3(10y ago)022AGPL-3.0PHPPHP &gt;=5.3.0

Since Jan 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ggiallo28/banbuilder)[ Packagist](https://packagist.org/packages/ggiallo28/banbuilder)[ Docs](http://banbuilder.com)[ RSS](/packages/ggiallo28-banbuilder/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (11)Used By (0)

BanBuilder Composer Package
===========================

[](#banbuilder-composer-package)

[![Gitter](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/snipe/banbuilder?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://camo.githubusercontent.com/2360bfc43a7e94a2ec4b887a8f257f0cd57c60695dbb47c47b3be6794d430923/68747470733a2f2f7472617669732d63692e6f72672f736e6970652f62616e6275696c6465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/snipe/banbuilder) [![Latest Stable Version](https://camo.githubusercontent.com/2e7c1f1635cbd0ac2fbe9e814701743e35e2cace76f42e09bae22afbcdec0a77/68747470733a2f2f706f7365722e707567782e6f72672f736e6970652f62616e6275696c6465722f762f737461626c652e737667)](https://packagist.org/packages/snipe/banbuilder) [![Total Downloads](https://camo.githubusercontent.com/63832b89f8f478f7fe5a5ad169032e48f6cfa0aa03fa4a557e49ac1ff8e39a73/68747470733a2f2f706f7365722e707567782e6f72672f736e6970652f62616e6275696c6465722f646f776e6c6f6164732e737667)](https://packagist.org/packages/snipe/banbuilder) [![Latest Unstable Version](https://camo.githubusercontent.com/3ab9a7d5a0b93a54165f2d23fc73e65a287c30185d6cc9aa75a598355f210847/68747470733a2f2f706f7365722e707567782e6f72672f736e6970652f62616e6275696c6465722f762f756e737461626c652e737667)](https://packagist.org/packages/snipe/banbuilder) [![License](https://camo.githubusercontent.com/6e543aebb6e01c66aefa8d5fd34eed5d4ce4e2a02e6bd2daabf56ad0a694b4a6/68747470733a2f2f706f7365722e707567782e6f72672f736e6970652f62616e6275696c6465722f6c6963656e73652e737667)](https://packagist.org/packages/snipe/banbuilder)

BanBuilder is a PHP package for profanity filtering. The PHP script uses regex to intelligently look for "leetspeak"-style numeric or symbol replacements.

Installing
----------

[](#installing)

To install BanBuilder, simply include it in your projects's `composer.json`.

```
"ggiallo28/banbuilder": "master",

```

There are no additional dependencies required for this package to work.

Usage
-----

[](#usage)

Please see the [official package website](https://banbuilder.com) for full usage details.

Summary
-------

[](#summary)

In a nutshell, this code takes an array of bad words and compares it to an array of common filter-evasion tactics. It then does a string replacement to insert regex parameters into your badwords array, and then evaluates your input string to that expanded banned word list.

So in your bad words array, you might have:

```
 [0] => 'ass'

```

The `preg_replace` functions replace all of the possible shenaningan letters with regex patterns (in lieu of adding the variants onto the end of the array), so the 'ass' in your array gets turned into this, right before the `preg_replace` checks for matches:

```
 [0] => /(a|a\.|a\-|4|@|Á|á|À|Â|à|Â|â|Ä|ä|Ã|ã|Å|å|α)(s|s\.|s\-|5|\$|§)(s|s\.|s\-|5|\$|§)/i

```

This means that a word can have none, one or any variety of leet replacements and it will still trip the trigger. Part of the leet filter includes stripping out letter-dash and letter-dots.

This means that the following all evaluate to the "bitch":

- B1tch
- bi7tch
- b.i.t.c.h.
- b-i-t-c-h
- b.1.t.c.h.
- ßitch
- and so on....

[![Flattr this git repo](https://camo.githubusercontent.com/7e3f46a36526479d701ef7f90a0f8c3ac2fbab3087446e2a9fceed75cd1ab802/687474703a2f2f6170692e666c617474722e636f6d2f627574746f6e2f666c617474722d62616467652d6c617267652e706e67)](https://flattr.com/submit/auto?user_id=snipe&url=https://github.com/snipe/banbuilder&title=banbuilder&language=PHP&tags=github&category=software)

Tests
-----

[](#tests)

To run the unit tests on this package, simply run `vendor/bin/phpunit` from the package directory.

---

License
-------

[](#license)

```
Copyright (C) 2013 Alison Gianotto - snipe@snipe.net

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see .

```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 71.5% 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

Every ~25 days

Recently: every ~51 days

Total

10

Last Release

3911d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8d7e6d7dd06954598845a39d5317b99062a1aefa3e68638aeba19b759861886a?d=identicon)[ggiallo28](/maintainers/ggiallo28)

---

Top Contributors

[![snipe](https://avatars.githubusercontent.com/u/197404?v=4)](https://github.com/snipe "snipe (88 commits)")[![0cool-f](https://avatars.githubusercontent.com/u/20709003?v=4)](https://github.com/0cool-f "0cool-f (7 commits)")[![jegtnes](https://avatars.githubusercontent.com/u/1315463?v=4)](https://github.com/jegtnes "jegtnes (6 commits)")[![ggiallo28](https://avatars.githubusercontent.com/u/9399273?v=4)](https://github.com/ggiallo28 "ggiallo28 (5 commits)")[![buzzedword](https://avatars.githubusercontent.com/u/334485?v=4)](https://github.com/buzzedword "buzzedword (2 commits)")[![AD7six](https://avatars.githubusercontent.com/u/33387?v=4)](https://github.com/AD7six "AD7six (2 commits)")[![TheInfernoX](https://avatars.githubusercontent.com/u/12787800?v=4)](https://github.com/TheInfernoX "TheInfernoX (2 commits)")[![thewilkybarkid](https://avatars.githubusercontent.com/u/1784740?v=4)](https://github.com/thewilkybarkid "thewilkybarkid (2 commits)")[![MicheleBertoli](https://avatars.githubusercontent.com/u/1308971?v=4)](https://github.com/MicheleBertoli "MicheleBertoli (1 commits)")[![rtxanson](https://avatars.githubusercontent.com/u/491085?v=4)](https://github.com/rtxanson "rtxanson (1 commits)")[![ryoshu](https://avatars.githubusercontent.com/u/176377?v=4)](https://github.com/ryoshu "ryoshu (1 commits)")[![bviolier](https://avatars.githubusercontent.com/u/1247610?v=4)](https://github.com/bviolier "bviolier (1 commits)")[![uberbrady](https://avatars.githubusercontent.com/u/36335?v=4)](https://github.com/uberbrady "uberbrady (1 commits)")[![dokinoki](https://avatars.githubusercontent.com/u/5940030?v=4)](https://github.com/dokinoki "dokinoki (1 commits)")[![emirozer](https://avatars.githubusercontent.com/u/5015104?v=4)](https://github.com/emirozer "emirozer (1 commits)")[![geo-at-github](https://avatars.githubusercontent.com/u/4470794?v=4)](https://github.com/geo-at-github "geo-at-github (1 commits)")[![mattclegg](https://avatars.githubusercontent.com/u/303487?v=4)](https://github.com/mattclegg "mattclegg (1 commits)")

---

Tags

languagestringsfilterprofanityswear

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ggiallo28-banbuilder/health.svg)

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

###  Alternatives

[snipe/banbuilder

Library to easily handle profanity filtering in PHP projects.

3371.5M3](/packages/snipe-banbuilder)[doctrine/inflector

PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.

11.4k855.8M711](/packages/doctrine-inflector)[phpoption/phpoption

Option Type for PHP

2.7k541.2M158](/packages/phpoption-phpoption)[diego-ninja/sentinel

A content moderation and sentiment analysis library for Laravel 10+

384.3k](/packages/diego-ninja-sentinel)[patrickschur/language-detection

A language detection library for PHP. Detects the language from a given text string.

8513.2M18](/packages/patrickschur-language-detection)[wapmorgan/morphos

A morphological solution for Russian and English language written completely in PHP. Provides classes to inflect personal names, geographical names, decline and pluralize nouns, generate cardinal and ordinal numerals, spell out money amounts and time.

8351.3M7](/packages/wapmorgan-morphos)

PHPackages © 2026

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