Filter

过滤输入参数,保障安全

这是一个使用范例:

Filter::run("POST", array( "group_id" => "int", "topic_id" => "int", "post_id" => "int", "title" => "string", "content" => "longString", ));

package

Tango

author

Zheng Kai zhengkai@gmail.com

Methods

工作方法

run(string $sMethod = "GET", array $lRule = array()) 
static
throws

Arguments

$sMethod

string

"POST" 或 "GET"

$lRule

array

包含要获取的参数的 key 和实际类型,并进行转换 字符串会被 utf8 编码过滤,不符合 utf8 编码的字符被丢弃 需要注意默认的 int 不允许有负值,否则请使用 signedInt

Properties

用来控制只检查一次

_bCheck : 
static

Type(s)

判断邮箱合法性的正则

_pEmail : 
static

not the full regexp, it is too crazy http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html

Type(s)