I am building a comment system that will allow users to post code. What security aspects should i be worried of concerning the input? Will it be enough to run the input through the XSS filter and escape special characters before storing it to the database? Something like this function:
function clean($conn,$input){
$input=htmlentities($input);
$input=mysqli_real_escape_string($conn,$input);
return $input;
}