google-profanity filter bad words using Google API

  1. Requirements
  2. Usage
  3. Resources

Filter bad words using Google Profanity API

Requirements

Yii 1.1 or above

Usage

put the zip file into your extension folder

and in your models

public function rules(){
        return array(
            array('username','ext.profanity.GoogleProfanityValidator',
                'replaceNumbers'=>true, // replace special characters to letters
                'trimLeft'=>true, // trim left character. e.g. 3fuck = fuck
                'trimRight'=>true, // trim right character. e.g fuck3 = fuck
                //'trim'=>'true', // default to false. delete left and right character. e.g 3fuck3 = fuck
                //'trimCharList'=>'0123456789', // char list for trimming, default to 0-9
            ),
        );
    }

Example Profanity

  1. suck1 = suck (if trimRight is true, remove character on right with "trimCharList")

  2. 1suck = suck (if trimLeft is true, remove character on left with "trimCharList")

  3. s3x = sex (if replaceNumbers = true, will replace to s3x = sex)

Resources

2 0
3 followers
479 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Validation
Developed by: bryglen
Created on: Mar 17, 2013
Last updated: 3 years ago

Downloads

show all

Related Extensions