I am probably using it wrong, the problem is this:
I have php code that gets echoed to the page like so:
<?php echo "<h1>" . htmlspecialchars($array['text']) . "</h1>" ?>
That variable gets echoed from the databse in an html structure like this
echo "<h1> Hello </h1>"
This works fine, but as soon as I echo something like "> text here"
everything breaks. The text appears at the beginning of the body and I can actually inject JS into it and .. it works.
I have no idea what I'm doing wrong, am I using htmlspecialchars
wrong or is the problem from somewhere else ?