XSS filtering function in PHP

前端 未结 10 1667
轮回少年
轮回少年 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条回答
  •  没有蜡笔的小新
    2020-11-27 11:45

    I found a solution for my problem with the posts with german umlaut. To provide from totally cleaning (killing) the posts, i encode the incoming data:

        *$data = utf8_encode($data);
        ... function ...*
    

    And at last i decode the output to get correct signs:

        *$data = utf8_decode($data);*
    

    Now the post go through the filter function and i get a correct result...

提交回复
热议问题