Download the PHP package imliamxo/shush without Composer
On this page you can find all versions of the php package imliamxo/shush. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package shush
π€« Shush
A configurable, multi-language profanity filter for Laravel with severity tiers, per-language normalisers, and evasion-resistant detection.
Catches shit, sh!t, sh1t, $h!t, shiiit, sshit, s.h.i.t β and everything in between. Ships with extensive English and Polish dictionaries out of the box.
Installation
Quick Start
Strictness Levels
Words are categorised into three severity tiers. The strictness setting controls which tiers are active:
| Strictness | Tiers caught | Use case |
|---|---|---|
relaxed |
severe only | Catch slurs & hate speech, allow swearing |
normal |
severe + moderate | Block strong profanity (default) |
strict |
severe + moderate + mild | Family-friendly, zero tolerance |
Evasion Detection
Each language has a dedicated normaliser that catches evasion techniques:
| Technique | Example | Caught? |
|---|---|---|
| Leet-speak symbols | sh!t, $h1t, b@stard |
β |
| Number substitution | sh1t, a55, f4g |
β |
| Repeated characters | shiiit, fuuuck, sshit |
β |
| Separator tricks | s.h.i.t, f-u-c-k, s h i t |
β |
| Mixed evasion | $h!iit, f.u.c.k |
β |
| Unicode homoglyphs | Cyrillic Π°/Π΅/ΠΎ lookalikes | β |
| Zero-width characters | Hidden unicode between letters | β |
| Diacritic stripping | Polish gΓ³wno β gowno |
β |
| Diacritic substitution | Δ
β a, Ε β l |
β |
Per-Language Normalisers
Each language can have its own normaliser that understands its character set and evasion patterns:
- English β handles standard leet-speak, homoglyphs, basic Latin diacritics
- Polish β handles
Δ βa,Δβc,Δβe,Εβl,Εβn,Γ³βo,Εβs,ΕΊβz,ΕΌβzstripping
Adding a Custom Normaliser
Register it in config/shush.php:
Or at runtime:
Built-in False-Positive Whitelist
Shush ships with an extensive whitelist of 200+ words that contain profanity substrings but aren't profane. This prevents false positives on words like:
Place names: Scunthorpe, Penistone, Cockermouth, Middlesex, Sussex, Essex, Effingham
Common words: class, classic, assess, assessment, asset, assign, assist, associate, assume, assembly, assault, bass, brass, glass, grass, mass, pass, passport, passion, passive, embarrass, harassment
Compound words: cocktail, cockatoo, cockerel, cockpit, peacock, Hitchcock, shuttlecock
Other: therapist, grapefruit, skyscraper, dictionary, predict, constitution, document, accumulate, circumstance, Mississippi
Polish false positives are also covered: kurier, kurort, kurczak, duplikat.
Adding Languages
Create a folder in resources/shush/dictionaries/:
Each file returns an array keyed by tier:
Flat arrays (no tier keys) are treated as moderate. All .php files in a language folder are merged.
Enable in config:
Modes
Censor (default)
Block
Middleware
Validation Rule
Runtime API
Configuration Reference
| Key | Default | Description |
|---|---|---|
mode |
censor |
censor or block |
strictness |
normal |
relaxed, normal, or strict |
normalise |
true |
Enable evasion detection |
normalisers |
[] |
Custom normaliser class map ['de' => MyClass::class] |
mask |
* |
Mask character for censor mode |
mask_behaviour |
character |
character or full |
mask_replacement |
*** |
Replacement when mask_behaviour is full |
languages |
['en'] |
Dictionary folders to load |
extra_words |
[] |
Additional words (string or {word, tier, language}) |
whitelist |
[] |
Extra words to never flag (merged with built-in whitelist) |
middleware_fields |
[] |
Request fields to scan (empty = all strings) |
Architecture
License
MIT