f ilter = new Filter($this->buildMetadataFactory(), new FilterLoader()); } public function tearDown() { parent::tearDown(); }在PHP中,有些很有用的函数开源非常方便的防止你的网站遭受各种攻击,例如SQL注入攻击,XSS(Cross Site scr ipting:跨站脚本)攻击等。所以就有了这个非常好用的基于标注的P
下面的函数可以用来过滤用户的输入,保证输入是XSS安全的。具体如何过滤,可以参看函数内部,也有注释。复制代码 代码如下:<?phpfunction RemoveXSS($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 th