MDL-14898 upgraded html purifier to 3.1.0 in HEAD

This commit is contained in:
skodak
2008-06-16 16:39:09 +00:00
parent b553527e99
commit eb203ee412
290 changed files with 4780 additions and 3432 deletions
+9 -11
View File
@@ -1,17 +1,15 @@
<?php
require_once 'HTMLPurifier/Token.php';
/**
* Factory for token generation (PHP 5 only).
* Factory for token generation.
*
* @note Doing some benchmarking indicates that the new operator is much
* slower than the clone operator (even discounting the cost of the
* constructor). This class is for that optimization. We may want to
* consider porting this to PHP 4 by virtue of the fact it makes the code
* easier to read. Other then that, there's not much point as we don't
* constructor). This class is for that optimization.
* Other then that, there's not much point as we don't
* maintain parallel HTMLPurifier_Token hierarchies (the main reason why
* you'd want to use an abstract factory).
* @todo Port DirectLex to use this
*/
class HTMLPurifier_TokenFactory
{
@@ -42,7 +40,7 @@ class HTMLPurifier_TokenFactory
*/
public function createStart($name, $attr = array()) {
$p = clone $this->p_start;
$p->HTMLPurifier_Token_Tag($name, $attr);
$p->__construct($name, $attr);
return $p;
}
@@ -53,7 +51,7 @@ class HTMLPurifier_TokenFactory
*/
public function createEnd($name) {
$p = clone $this->p_end;
$p->HTMLPurifier_Token_Tag($name);
$p->__construct($name);
return $p;
}
@@ -65,7 +63,7 @@ class HTMLPurifier_TokenFactory
*/
public function createEmpty($name, $attr = array()) {
$p = clone $this->p_empty;
$p->HTMLPurifier_Token_Tag($name, $attr);
$p->__construct($name, $attr);
return $p;
}
@@ -76,7 +74,7 @@ class HTMLPurifier_TokenFactory
*/
public function createText($data) {
$p = clone $this->p_text;
$p->HTMLPurifier_Token_Text($data);
$p->__construct($data);
return $p;
}
@@ -87,7 +85,7 @@ class HTMLPurifier_TokenFactory
*/
public function createComment($data) {
$p = clone $this->p_comment;
$p->HTMLPurifier_Token_Comment($data);
$p->__construct($data);
return $p;
}