blaspsoft/blasp
Blasp is a powerful and customisable profanity filter package for Laravel applications
v4.0.1
293K downloads/mo
#4792 most downloaded on Packagist
Blaspsoft/blasp
What this package is like to depend on
Last release 4 months ago
27 Mar 2026
Release timing varies
gaps range from 2 weeks to 6 months
Most releases are documented
notes for 12 of 20 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
20 releases · first in 2024
13 releases in the last 12 months
see the full history below
Release timeline
20 releases · Oct 2024 to Mar 2026Releases
latest 20-
v4.0.127 Mar 2026Release notes
Open source →Bug Fixes
- Invisible Unicode bypass: Strip
\p{Cf}format characters (zero-width spaces, invisible separators) from input before processing, so profanity likefuck(with U+2063) is correctly detected - Asterisk censoring bypass: Add
*as a universal letter substitution so censored profanity likef*g,s**t,f**kis detected - Internal masking: Use
\x01instead of*for internal masking during detection loop to prevent re-matching masked text - Null safety: Guard against
preg_replacereturning null on malformed UTF-8 input
- Invisible Unicode bypass: Strip
-
v4.0.026 Mar 2026Release notes
Open source →Blasp v4.0.0
A ground-up rewrite with a driver-based architecture, severity scoring, and deep Laravel integration.
New Features
- Driver-based architecture —
regex(obfuscation/substitution detection),pattern(fast exact matching),phonetic(sound-alike evasion via metaphone + Levenshtein), andpipeline(chain multiple drivers together). Extend with custom drivers. - Severity scoring — Profanities categorised as mild/moderate/high/extreme with per-word weights and a 0–100 composite score. Filter by minimum severity threshold.
- Multi-language support — English, Spanish, German, French with language-specific normalizers and severity maps. Check one, many, or all at once via fluent API.
- Masking strategies — Character mask (
*,#), grawlix (!@#$%), or a custom callback. - Eloquent integration —
Blaspabletrait auto-sanitizes or rejects profanity on model save, withwithoutBlaspChecking()for bypassing. - Middleware —
CheckProfanitymiddleware to reject or sanitize profane request fields with configurable severity and field filtering. - Validation rule —
blasp_checkrule with language support. - Blade directive —
@clean($text)for output sanitization. - Str/Stringable macros —
Str::isProfane(),Str::cleanProfanity(), and Stringable equivalents. - Result caching — Configurable cache driver, TTL, and key eviction.
- Events —
ProfanityDetected,ContentBlocked,ModelProfanityDetected. - Testing utilities —
Blasp::fake()for test doubles with assertions.
Breaking Changes
- Namespace flattened —
Blaspsoft\Blasp\Laravel\merged intoBlaspsoft\Blasp\. Update any direct class references. - Service provider renamed —
ServiceProvider→BlaspServiceProvider(auto-discovery handles this). - Config file renamed —
config/config.php→config/blasp.php. Re-publish withphp artisan vendor:publish --tag="blasp-config". - API changes —
check()now returns aResultobject withisOffensive(),clean(),score(),severity(),count(),words(),uniqueWords(). Previous methods likehasProfanity(),getCleanString(),getProfanitiesCount()are removed.
Compatibility
- PHP 8.2+
- Laravel 8.0 – 13.x
Full Changelog
- Driver-based architecture —
-
v3.1.911 Feb 2026Release notes
Open source →Bug Fix
- Fix false positives when profanity is a substring of a regular word — Words like
space,spacious,aerospace,workspacewere incorrectly flagged because the profanityspacmatched as a substring. Instead of adding more words to the false positives list, a systematic check now automatically skips pure alphabetic profanity matches embedded inside larger regular words.
Still detected
- Standalone profanity (
spac,fuck,ass) - Obfuscated variants (
sp@c,f-u-c-k,a$$) - Conjugated forms (
fucks,fucker,fuckings) - Compound profanity (
cuntfuck,fuckingshitcuntfuck) - Repeated-letter obfuscation (
ccuunntt,fuuuck)
No longer falsely flagged
- Any regular word containing a profanity substring (
space,spacious,aerospace,cocktails,class, etc.)
Closes #32
- Fix false positives when profanity is a substring of a regular word — Words like
-
v3.1.803 Feb 2026Release notes
Open source →Bug Fixes
- Fixed false positives when profanity detection incorrectly matched across separate words:
"an alert"no longer flags"anal""has 5 faces"no longer flags"ass"
The fix distinguishes between intentional obfuscation (like
"@ss"which contains letters + special characters) and accidental word combinations (like"an al"which contains only letters).What's Changed
- Improved
isSpanningWordBoundary()logic to check if standalone portions contain both letters AND non-letter characters - Added test cases for the new edge cases
- Fixed false positives when profanity detection incorrectly matched across separate words:
-
v3.1.728 Jan 2026Release notes
Open source →What's Changed
Bug Fixes
-
fix: detect partial spacing profanity obfuscation - Profanity obfuscation using partial spacing is now correctly detected:
"s hit"→ detected as "shit""f uck"→ detected as "fuck""t wat"→ detected as "twat""fu c k"→ detected as "fuck""tw a t"→ detected as "twat"
-
fix: convert byte offset to character offset for multibyte support - Fixed boundary checks to work correctly with multibyte characters (accented letters in French, German, etc.)
Technical Details
The
isSpanningWordBoundary()method was refactored to check surrounding context instead of relying on heuristics about single-character parts. This ensures partial spacing obfuscation is detected while still preventing false positives like"This musicals hit".Full Changelog: v3.1.6...v3.1.7
-
-
v3.1.627 Jan 2026Release notes
Open source →Bug Fixes
- Fix accented character false positives (#24): Added
/u(PCRE_UTF8) flag to generated profanity regex patterns, preventing multi-byte UTF-8 characters (e.g.ê,é) from being matched byte-by-byte and causing false positives on words like "tête" and "aré". - Validate UTF-8 input: Added encoding validation at the
check()entry point to sanitize non-UTF-8 strings before regex matching, preventing silentpreg_matchfailures.
- Fix accented character false positives (#24): Added
-
v3.1.527 Jan 2026 -
v3.1.427 Jan 2026Release notes
Open source →Bug Fix
- Fix false positive detection for common words (#32) — Words like "assignment", "passion", "classroom", "passenger" were incorrectly flagged because they contain the substring "ass". Added ~200 common English words to the
false_positiveslist covering substrings:ass,tit,cum,nig,rap,nob.
- Fix false positive detection for common words (#32) — Words like "assignment", "passion", "classroom", "passenger" were incorrectly flagged because they contain the substring "ass". Added ~200 common English words to the
-
v3.1.327 Jan 2026Release notes
Open source →Bug Fix
- Fix UUID flagged as profanity (#23) — UUIDs like
6ec3e80f-...-144a2ef5800bwere incorrectly flagged because800bmapped toboobvia character substitutions. Added anisInsideHexToken()guard that skips matches inside UUIDs, MD5/SHA hashes, and other long hex strings while leaving normal profanity detection intact.
- Fix UUID flagged as profanity (#23) — UUIDs like
-
v3.1.227 Jan 2026Release notes
Open source →Bug Fix
- Fix circular substitution handling (#35) — Replaced sequential
preg_replacewith a single-pass character walker that prevents circular substitutions (e.g., Frenchc→kandk→c) from producing malformed regex. Multi-char substitution values now use alternation instead of character classes. Language-specific substitutions are properly merged again.
- Fix circular substitution handling (#35) — Replaced sequential
-
v3.1.126 Jan 2026Nothing published for this version
-
v3.1.003 Dec 2025Nothing published for this version
-
v3.0.005 Sep 2025Release notes
Open source →Added
- Custom mask character support with
maskWith()method - Simplified API with Laravel facade pattern and method chaining
- Comprehensive multi-language support (Spanish, German, French)
- Expanded test coverage across all languages
- Comprehensive extensibility system with full test coverage
- Basic registry pattern for language normalizers
- Language files publishing to ServiceProvider
- Comprehensive documentation for maskWith() and all chainable methods
Changed
- Implemented dependency injection and simplified service dependencies
- Extracted expression generation logic to dedicated generator
- Improved substitution detection across all languages
- Updated README with simplified chainable API documentation
- Updated README with comprehensive multi-language support documentation
- Updated README with language files publishing options
- Updated README for v3.0 features
Fixed
- Resolved language switching not loading correct profanities
- Prevented cross-word-boundary profanity matches
Removed
- Strategy factory, plugin manager, and default detection strategy
- Domain-specific detection strategies (email, URL, phone)
- Unused strict() and lenient() detection modes
- README duplications and outdated references
- Custom mask character support with
-
v2.1.027 Feb 2025Nothing published for this version
-
v2.0.027 Feb 2025Nothing published for this version
-
v1.2.227 Nov 2024Nothing published for this version
-
v1.2.125 Oct 2024Nothing published for this version
-
v1.2.021 Oct 2024Nothing published for this version
-
v1.1.020 Oct 2024Nothing published for this version
-
v1.0.019 Oct 2024