mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-04 13:18:00 +02:00
Add support for hard exclusions that affect all child nodes.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@146 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -208,6 +208,16 @@ class HTMLPurifier_Definition
|
||||
$this->info[$name]->type = 'block';
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// info[]->excludes : defines elements that aren't allowed in here
|
||||
|
||||
// make sure you test using isset() and not !empty()
|
||||
|
||||
$this->info['a']->excludes = array('a' => true);
|
||||
$this->info['pre']->excludes = array_flip(array('img', 'big', 'small',
|
||||
// technically in spec, but we don't allow em anyway
|
||||
'object', 'applet', 'font', 'basefont'));
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// info[]->attr : defines allowed attributes for elements
|
||||
|
||||
@@ -233,6 +243,8 @@ class HTMLPurifier_Definition
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// info[]->auto_close : tags that automatically close another
|
||||
|
||||
// make sure you test using isset() not !empty()
|
||||
|
||||
// these are all block elements: blocks aren't allowed in P
|
||||
$this->info['p']->auto_close = array_flip(array(
|
||||
'address', 'blockquote', 'dd', 'dir', 'div', 'dl', 'dt',
|
||||
@@ -265,6 +277,7 @@ class HTMLPurifier_ElementDef
|
||||
var $auto_close = array();
|
||||
var $child;
|
||||
var $type = 'unknown';
|
||||
var $excludes = array();
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user