php過濾XSS攻擊的函式是什麼呢?以下是小編分享php過濾XSS攻擊的函式,就跟隨本站小編一起去了解下吧,想了解更多相關資訊請持續關注我們應屆畢業生考試網!
以下函式:
過濾使用者的`輸入,保證輸入是XSS安全的。
例子:
複製程式碼 程式碼示例:
<?php
/**
* 過濾XSS攻擊
* edit:
*/
function 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 <java