I'm creating an app that retrieves the text within a tweet, store it in the database and then display it on the browser. The problem is that I'm thinking if the text has PHP tags or HTML tags it might be a security breach there.
I looked into strip_tags() but saw some bad reviews. I also saw suggestions to HTML Purifier but it was last updated years ago.
So my question is how can I be 100% secure that if the tweet text is "<script> something_bad() </script>" it won't matter?
To state the obvious the tweets are sent to the database from users so I don't want to check all individually before displaying them.
echo $string_with_php, then NOTHING will happen. it's just some text and will NOT get executed. browsers have no idea what php is, and don't care. - Marc B<?php something_bad() ?>in the database, but about<script>something_bad()</script>and not sanitizing the values before sending them to the browser - Alvaro Montoro