I have a custom forum in which I employ htmlentities so users aren’t able to post malicious code(html/js). Anyway, as I am pulling posts from the database, I use str_replace in order to show certain html elements <, >, &, etc.. is there any harm in doing this? Will it cause side effects/html to render?
Share
htmlentitiesorhtmlspecialchars, or some subset of allowed characters. You could do this withstr_replace, but there are better utilities).