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 find my site has been hacked or someone typoed and destroyed everything or accessed things they shouldn't.
Is there any easy way to verify that the text they input is css only? I saw another question on here that was similar, it had XSS cheat sheet and tips for what to disable (< and ]]> and < ![), but I don't know if that will be enough. I will definitely use that info though.
Essentially I want to just make PHP call any custom css and insert it between script tags for the users profile. I want to allow as much css as possible. Is this the best way to go about it? I don't have the know how to make up a system to generate safe files, or the patience to make up an entire section with options (especially since I want to give members more freedom with their profiles).
Any advice is appreciated, and if anyone knows of some script that does this already that would rock too and help me figure out what to do :D.
* { font-family: 'Comic Sans' !important; }into their custom stylesheet? It will affect your website components as well. You could parse the stylesheet with PHP and prepend#user-content >to each selector and output a sanitized stylesheet, but that might be difficult.