2017 © Pedro Peláez
 

library input_handle

数据过滤库,数据类型处理,SQL注入,XSS过滤等

image

helbing/input_handle

数据过滤库,数据类型处理,SQL注入,XSS过滤等

  • Tuesday, December 5, 2017
  • by helbing
  • Repository
  • 1 Watchers
  • 0 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Introduce

input_handle是一个数据过滤库,提供XSS过滤,简单SQL注入过滤和数据类型转换, (*1)

Usage

简单使用

$handle = new inputHandle();

$data = $handle->inputHandle($data, InputHandle::TYPE_STRING, $defaultVal);

调用函数做额外的处理

inputHandle函数的第四个参数可以添加一些trim,htmlspecialchars等函数对数据做一些额外的处理, (*2)

$handle = new inputHandle();

$data = $handle->inputHandle($data, InputHandle::TYPE_STRING, $defaultVal, 'trim,htmlspecialchars');

自定义过滤

创建自定义过滤类,并实现Helbing\Handle\Factory接口函数, (*3)


use Helbing\Handle\Factory; class MyFilter implements Factory { public function name() { return 'filter-name'; } public function filter($input) { return doSomething($input); } }

使用自定义过滤, (*4)

$handle = new inputHandle();

$handle->push(new MyFilter());

$data = $handle->inputHandle($data, InputHandle::TYPE_STRING);

Require

The Versions

05/12 2017

dev-master

9999999-dev

数据过滤库,数据类型处理,SQL注入,XSS过滤等

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar helbing

05/12 2017

v0.1.0

0.1.0.0

数据过滤库,数据类型处理,SQL注入,XSS过滤等

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar helbing