I'd like to parse a RSS Feed and display the content on my website(php,html).
But I'd like to html-encode the feed to prevent xss attacks. But how do I do this properly?
1.) How can I html-encode an url so that it will work afterwards? If I use htmlspecialchars for an entiere url the url won't work anymore.
2.) The Titel of the RSS Feed is already html-encoded. But I'd like to do it again by myself to be sure there can't be xss content inside it. But how I can I html-encode already encoded html? If I use htmlspecialchars twice the html output will show the escape commands instead of the right symbol.