When is it best to sanitize user input?

前端 未结 14 885
萌比男神i
萌比男神i 2020-12-01 04:08

User equals untrustworthy. Never trust untrustworthy user\'s input. I get that. However, I am wondering when the best time to sanitize input is. For example, do you blindly

14条回答
  •  执念已碎
    2020-12-01 04:40

    I find that cleaning it immediately has two advantages. One, you can validate against it and provide feedback to the user. Two, you do not have to worry about consuming the data in other places.

提交回复
热议问题