What are the best practices for avoiding xss attacks in a PHP site

前端 未结 20 2351
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-22 02:34

I have PHP configured so that magic quotes are on and register globals are off.

I do my best to always call htmlentities() for anything I am outputing that is derive

20条回答
  •  死守一世寂寞
    2020-11-22 03:28

    There are a lot of ways to do XSS (See http://ha.ckers.org/xss.html) and it's very hard to catch.

    I personally delegate this to the current framework I'm using (Code Igniter for example). While not perfect, it might catch more than my hand made routines ever do.

提交回复
热议问题