{"id":18947342,"url":"https://github.com/arif-rh/profanity-filter","last_synced_at":"2026-03-26T22:30:20.043Z","repository":{"id":62486858,"uuid":"301031555","full_name":"arif-rh/profanity-filter","owner":"arif-rh","description":null,"archived":false,"fork":false,"pushed_at":"2020-10-13T06:25:44.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T03:18:41.199Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arif-rh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-04T03:24:42.000Z","updated_at":"2020-10-13T06:25:46.000Z","dependencies_parsed_at":"2022-11-02T09:31:03.581Z","dependency_job_id":null,"html_url":"https://github.com/arif-rh/profanity-filter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arif-rh%2Fprofanity-filter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arif-rh%2Fprofanity-filter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arif-rh%2Fprofanity-filter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arif-rh%2Fprofanity-filter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arif-rh","download_url":"https://codeload.github.com/arif-rh/profanity-filter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239946875,"owners_count":19723014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T13:09:43.117Z","updated_at":"2026-03-26T22:30:19.967Z","avatar_url":"https://github.com/arif-rh.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Profanity Filter\n\nA simple class to test if a string has a profanity in it.\n\nNote: \n\n* This package is extended version from [DeveloperDino\\ProfanityFilter](https://github.com/developerdino/ProfanityFilter), with some extra new features.\n\n## NEW FEATURE\n---------------\n* `cleanWords` : obfuscate only the bad words, original package will obfuscate all sentence [see this issue](https://github.com/developerdino/ProfanityFilter/issues/20).\n  ````\n  // assume that 'badword' is a bad word\n  $words = 'This is a badword';\n\n  echo $check-\u003ecleanWords($words);\n  // output -\u003e This is a *******\n\n  echo $check-\u003ecleanWords($words, '+');\n  // output -\u003e This is a +++++++\n  ````\n* `getBadWordsfound` -\u003e get bad word string from check\n  ````\n  // assume that 'badword' is a bad word\n  $words = 'This is a badword';\n\n  $check-\u003ehasProfanity($words);\n  echo $check-\u003egetBadWordsFound();\n  // output -\u003e badword\n\n* Whitelists : Set some whitelist word to fix [false positive issue](https://github.com/developerdino/ProfanityFilter/issues/21) filter\n  ````\n  // Set whitelist when initialize the class\n  $filter = new Check($profinities, $whitelist);\n\n  See `NotProfaneTest` to see more example of whitelist test\n  ````\n\n## Checks performed\n\n### Straight matching\n\nChecks string for profanity as it is against list of bad words. E.g. `badword`\n\n### Substitution\n\nChecks string for profanity with characters substituted for each letter. E.g. `bâdΨ0rd`\n\n### Obscured\n\nChecks string for profanity obscured with punctuation between. E.g. `b|a|d|w|o|r|d`\n\n### Doubled\n\nCheck string for profanity that has characters doubled up. E.g. `bbaaddwwoorrdd`\n\n### Combinations\n\nAlso works with combinations of the above. E.g. `b|â|d|Ψ|0|rr|d`\n\n## Installation\n\nInstall this package via composer.\n\n```\nphp composer.phar require developer/profanity-filter\n```\n\n## Usage\n```php\n/* default constructor */\n$check = new Check();\n$hasProfanity = $check-\u003ehasProfanity($badWords);\n$cleanWords = $check-\u003eobfuscateIfProfane($badWords);\n\n/* customized word list from file */\n$check = new Check('path.to/wordlist.php');\n\n/* customized word list from array */\n$badWords = array('bad', 'words'); // or load from db\n$check = new Check($badWords);\n```\n\n### License\n\nProfanityFilter is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farif-rh%2Fprofanity-filter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farif-rh%2Fprofanity-filter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farif-rh%2Fprofanity-filter/lists"}