//ThinkPHP3.1以上版本 开启全局过滤时的安全过滤问题,$_post $_POST 和 create() 的对比 |
'VAR_FILTERS' => 'htmlspecialchars' // config文件里开启全局过滤 |
$this ->_post( 'xxx' ); // 会过滤 |
$_POST [ 'xxx' ]; // 不过滤 |
xxxmodel->create(); // 不过滤,需要在模型中设置自动完成 protected $_auto = array( array('xxx', 'htmlspecialchars', 3, 'function') ); |
//如果需要保存html编辑器提交的内容,可用TP内置的remove_xss函数 |