Square1;10995693 wrote:Thank you. So to beat a dead horse, all data that is displayed as a result of queries as well as any data coming in from user input needs to cleansed with htmlentities.
Ultimately, there is no single, correct, all-inclusive answer to that, other than, "It depends." For instance, if you are creating a blog app that is designed to accept HTML marked up text for the actual article text, then you probably would not want to apply striptags() or htmlentities() to it when outputting it to the browser.
A decent general rule is to apply htmlentities() to text being output to a browser when that text is not expected/allowed to contain HTML mark-up of any kind.