mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-30 19:00:10 +02:00
De-singleton-ized (HTML|CSS)Definition, tying them to the configuration and making them more amenable to changes.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@350 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -78,29 +78,10 @@ class HTMLPurifier_HTMLDefinition
|
||||
*/
|
||||
var $info_attr_transform_post = array();
|
||||
|
||||
/**
|
||||
* Retrieve sole instance of definition object.
|
||||
* @param $prototype Optional prototype to overload instance with.
|
||||
* @warning Prototype is not passed by reference, so in order to get
|
||||
* a copy of the real one, you'll have to destroy your copy
|
||||
* and use instance() to get it. We strongly recommend modifying
|
||||
* the default returned definition instead.
|
||||
*/
|
||||
function &instance($prototype = null) {
|
||||
static $instance = null;
|
||||
if ($prototype) {
|
||||
$instance = $prototype;
|
||||
} elseif (!$instance) {
|
||||
$instance = new HTMLPurifier_HTMLDefinition();
|
||||
$instance->setup();
|
||||
}
|
||||
return $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the definition, the meat of the class.
|
||||
*/
|
||||
function setup() {
|
||||
function setup($config) {
|
||||
|
||||
// emulates the structure of the DTD
|
||||
// these are condensed, however, with bad stuff taken out
|
||||
|
Reference in New Issue
Block a user