The main issues that need to be prevented are broken queries and embedded queries. That is what escaping data or using prepared statements prevents when handling uncontrolled input.
Thanks for the link. That was a VERY interesting article!!
The main thing that I’ve taken away from my research online, is that you have to customize “data sanitizing” for the particular data and application of the data to really be secure.
It is always a good idea to use functions such as htmlspecialchars and strip_tags
However, over time, you can have your own function which will take a string and clean it to your preferences. I’ve noticed that through the years, I’ve used a similar function that takes a string, and really sifts through sketchy tags / characters.