I know there is a lot of discussion for years on best methods of filtering data with PHP but I would like to go the whitelist approach in my current project.
I only want a user to be able to use the following HTML
<b>bold</b>
<i>italics</i>
<u>underline</u>
<s>strikethrough</s>
<big>Big size</big >
<small>Small size</small>
Hyperlink <a href="http://www.site.com">website</a>
A Bulleted List:
<ul>
<li>One Item</li>
<li>Another Item</li>
</ul>
An Ordered List:
<ol>
<li> First Item</li>
<li> Second Item</li>
</ol>
<blockquote>Because it is indented</blockquote>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
Can anyone show me the best method of doing this for performance in PHP? I have only in the past allowed all html minus certain codes