mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-02 20:27:40 +02:00
[1.7.0] Modify addElement to return a reference to the created definition, shorten other HTMLModules accordingly.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1046 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -137,9 +137,11 @@ class HTMLPurifier_HTMLModule
|
||||
* element?
|
||||
* @param $attr What unique attributes does the element define?
|
||||
* @note See ElementDef for in-depth descriptions of these parameters.
|
||||
* @return Reference to created element definition object, so you
|
||||
* can set advanced parameters
|
||||
* @protected
|
||||
*/
|
||||
function addElement($element, $safe, $type, $contents, $attr_includes, $attr = array()) {
|
||||
function &addElement($element, $safe, $type, $contents, $attr_includes, $attr = array()) {
|
||||
$this->elements[] = $element;
|
||||
// parse content_model
|
||||
list($content_model_type, $content_model) = $this->parseContents($contents);
|
||||
@@ -153,6 +155,7 @@ class HTMLPurifier_HTMLModule
|
||||
);
|
||||
// literal object $contents means direct child manipulation
|
||||
if (!is_string($contents)) $this->info[$element]->child = $contents;
|
||||
return $this->info[$element];
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user