How do I ensure user input is CSS and not malicious code?

后端 未结 3 1252
自闭症患者
自闭症患者 2021-01-18 01:54

On my website I want to include a text box that will allow the members to change anything they want css wise on their profiles....but I don\'t want to wake up one morning to

3条回答
  •  無奈伤痛
    2021-01-18 02:53

    O hai MySpace…

    Just give users the ability to specify colours and images from a web form, and construct a user-specific style sheet from that. Allowing users to specify their own CSS in its entirety will just lead to ugly, ugly pages. See: MySpace 1.0.

提交回复
热议问题