For example if I am colecting a [URL value] in a form, saving that [URL value] in a database, and then using it in a page like this:
<a href="[URL value]" > The Link </a>
How do I protect against this [URL value]:
http://www.somelink.com"> Evil text or can be empty </a> ALL THE EVIL HTML I WANT <a href="
How can I protect against this kind of HTML injection for URL form fileds without breaking the URL in case it is valid ?