Giter Site home page Giter Site logo

codeigniter-blacklist-library's Introduction

Blacklist

Version 1.0

Original thoughts borrowed from a framework called egp .

DESCRIPTION

This is a simple blacklist library written for CodeIgniter 1.7.x and the to-be-released CI 2.0.

If you are googling a solution ONLY for preventing your app from spam blood, I STRONGLY recommend you using Wordpress Akismet service instead of this library. However, if you'd like to take full control of your blacklist dictionary, i.e., your application requires Internet censorship capabilities, you can consider this library.

FEATURES

  1. IP-address filtering.
  2. Keyword-based string filtering
  3. Regex-based string filtering

INSTALLATION

CodeIgniter

  1. Put Blacklist.php into your application/libraries folder
  2. Put blacklist.php into your application/config folder
  3. Load it like normal: $this->load->library('blacklist'); OR you can autoload it.

For other framework or app

Dive into the code, you can find that it can be easily migrated to other apps without making hands dirty.

Usage

Check if the given text block contains forbidden keywords (return TRUE if it does exist, otherwise, return FALSE):

$this->blacklist->check_text('I am a spammer!')->is_blocked();

Check if the client IP is blocked by the system (return TRUE if it is blocked) :

$this->blacklist->check_ip('1.1.1.1')->is_blocked();

If a forbidden keyword (such as word 'spammer') was found in the given text block, we can do the following replacement:

$this->blacklist->replace('I am a spammer!', '@');

After this, The original text will be turned into 'I am a @@@@@@@!'

codeigniter-blacklist-library's People

Contributors

cnsaturn avatar

Watchers

James Cloos avatar domainbank avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.