I want to filter my output to make it safer from Cross site scripting (XSS) attacks so I am filtering output with htmlentities. The problem is, I am trying to make my application utf8 compatible so when I enter something like ಠ_ಠ I would like it to be maintained when retrieved from the database. Is there a simple solution to achieve this? Thanks in advance for any advice.
Share
Three things
htmlentities()–htmlspecialchars()is sufficient.htmlentities()is used only when trying to render a content from a character-encoding that is disparate from native encoding.So, finally:
Where if you used ENT_NOQUOTES you could be vulnerable to some types of XSS.