XSS filtering function in PHP

前端 未结 10 1664
轮回少年
轮回少年 2020-11-27 11:18

Does anyone know of a good function out there for filtering generic input from forms? Zend_Filter_input seems to require prior knowledge of the contents of the input and I\'

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 11:50

    function clean($data){
        $data = rawurldecode($data);
        return filter_var($data, FILTER_SANITIZE_SPEC_CHARS);
    }
    

提交回复
热议问题