当前位置: 首页 >
2017年3月15日发布的所有文章
-
过滤SQL关键字,mysql入库字段过滤
/** * 过滤SQL关键字,mysql入库字段过滤 * @param $val 要过滤的字符串 * @return mixed */ function sql_replace($val){ $val = str_replace(“\t”, '', $val); $val = str_replace(“%20”, '', $val); $val = str_replace(“%27”, '', $val) ...
-
移除xss代码
/** * 移除xss代码 * @param $val 要过滤的字符 */ function remove_xss($val){ // remove all non-printable characters. CR(0a) and LF(0b) and TAB(9) are allowed // this prevents some character re-spacing such as // note that you have to handle splits with \n, \r, and \t later since they ...