MDL-10937 upgraded html purifier to 2.1.1
This commit is contained in:
@@ -5,14 +5,6 @@
|
||||
WARNING: THIS MODULE IS EXTREMELY DANGEROUS AS IT ENABLES INLINE SCRIPTING
|
||||
INSIDE HTML PURIFIER DOCUMENTS. USE ONLY WITH TRUSTED USER INPUT!!!
|
||||
|
||||
Usage:
|
||||
|
||||
require_once 'HTMLPurifier/HTMLModule/Scripting.php';
|
||||
$def =& $config->getHTMLDefinition(true); // get the raw version
|
||||
$def->manager->addModule('Scripting');
|
||||
|
||||
This must come before any other calls to getHTMLDefinition()
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -46,8 +38,12 @@ class HTMLPurifier_HTMLModule_Scripting extends HTMLPurifier_HTMLModule
|
||||
// blockquote's custom definition (we would use it but
|
||||
// blockquote's contents are optional while noscript's contents
|
||||
// are required)
|
||||
|
||||
// TODO: convert this to new syntax, main problem is getting
|
||||
// both content sets working
|
||||
foreach ($this->elements as $element) {
|
||||
$this->info[$element] = new HTMLPurifier_ElementDef();
|
||||
$this->info[$element]->safe = false;
|
||||
}
|
||||
$this->info['noscript']->attr = array( 0 => array('Common') );
|
||||
$this->info['noscript']->content_model = 'Heading | List | Block';
|
||||
@@ -59,9 +55,9 @@ class HTMLPurifier_HTMLModule_Scripting extends HTMLPurifier_HTMLModule
|
||||
);
|
||||
$this->info['script']->content_model = '#PCDATA';
|
||||
$this->info['script']->content_model_type = 'optional';
|
||||
$this->info['script']->attr_transform_pre['type'] =
|
||||
$this->info['script']->attr_transform_post['type'] =
|
||||
new HTMLPurifier_AttrTransform_ScriptRequired();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user