strip_harmful_tags: expand the allowed list

This commit is contained in:
Andrew Dolgov 2013-03-19 14:32:26 +04:00
parent 23923ca726
commit 10b55a120c
1 changed files with 9 additions and 3 deletions

View File

@ -2624,9 +2624,15 @@
function strip_harmful_tags($doc) {
$entries = $doc->getElementsByTagName("*");
$allowed_elements = array('p', 'br', 'div', 'table', 'tr', 'td', 'th',
'ul', 'ol', 'li', 'blockquote', 'span', 'html', 'body', 'a', 'img',
'video', 'audio', 'source', 'object', 'embed');
$allowed_elements = array('a', 'address', 'audio',
'b', 'big', 'blockquote', 'body', 'br', 'cite',
'code', 'dd', 'del', 'details', 'div', 'dl',
'dt', 'em', 'footer', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
'header', 'html', 'i', 'iframe', 'img', 'ins', 'kbd',
'li', 'nav', 'ol', 'p', 'pre', 'q', 's','small',
'source', 'span', 'strike', 'strong', 'sub', 'summary',
'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead',
'tr', 'track', 'tt', 'u', 'ul', 'var', 'wbr', 'video' );
if ($_SESSION['hasSandbox']) array_push($allowed_elements, 'iframe');