Skip to content

Releases: Blaspsoft/blasp

v3.1.9

11 Feb 15:39

Choose a tag to compare

Bug Fix

  • Fix false positives when profanity is a substring of a regular word — Words like space, spacious, aerospace, workspace were incorrectly flagged because the profanity spac matched 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

v3.1.8

03 Feb 13:51

Choose a tag to compare

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

v3.1.7

28 Jan 21:17
7190213

Choose a tag to compare

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.6

27 Jan 13:29
5e1e0fc

Choose a tag to compare

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 silent preg_match failures.

v3.1.5

27 Jan 12:45
0f4b293

Choose a tag to compare

Bug Fixes

  • check() no longer throws on empty/null strings (#29, #42) — Blasp::check() now accepts ?string and returns a clean result for empty or null input instead of throwing an exception.

v3.1.4

27 Jan 12:25
c4037af

Choose a tag to compare

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_positives list covering substrings: ass, tit, cum, nig, rap, nob.

v3.1.3

27 Jan 10:57
dffff5b

Choose a tag to compare

Bug Fix

  • Fix UUID flagged as profanity (#23) — UUIDs like 6ec3e80f-...-144a2ef5800b were incorrectly flagged because 800b mapped to boob via character substitutions. Added an isInsideHexToken() guard that skips matches inside UUIDs, MD5/SHA hashes, and other long hex strings while leaving normal profanity detection intact.

v3.1.2

27 Jan 10:21
cf7e986

Choose a tag to compare

Bug Fix

  • Fix circular substitution handling (#35) — Replaced sequential preg_replace with a single-pass character walker that prevents circular substitutions (e.g., French c→k and k→c) from producing malformed regex. Multi-char substitution values now use alternation instead of character classes. Language-specific substitutions are properly merged again.

v3.1.1

26 Jan 20:45
f056f5f

Choose a tag to compare

Bug Fixes

  • Fixed spaced profanity detection (#36) - Spaced-out obfuscation like f u c k i n g is now correctly detected as profanity

What changed

The isSpanningWordBoundary() method was incorrectly rejecting intentional obfuscation where characters are separated by spaces. The fix distinguishes between:

  • Intentional obfuscation (all parts are single chars) → now detected ✅
  • Cross-word accidents (only some parts are single chars) → still rejected to avoid false positives

Example

$result = Blasp::check('This is f u c k 1 n g awesome!');
$result->hasProfanity; // true ✅

Full Changelog: v3.1.0...v3.1.1

v3.1.0

03 Dec 13:13
c2b8d31

Choose a tag to compare

What's New

Custom Cache Driver Configuration

You can now specify a custom cache driver for Blasp, which is particularly useful for environments like Laravel Vapor where the default cache driver (DynamoDB) has size limits that can be exceeded when caching profanity expressions.

Usage

Set via config:

// config/blasp.php
'cache_driver' => env('BLASP_CACHE_DRIVER'),

Or via environment variable:

BLASP_CACHE_DRIVER=redis

Credits

This feature was originally proposed by @dimzeta in #25 and has been adapted for Blasp v3.0 architecture.

Full Changelog: v3.0.0...v3.1.0