From d4949327efa15b492cab1bef3fe074290a328a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 21 Feb 2014 15:43:14 +0100 Subject: [add] HTML Purifier added to clean code --- .../htmlpurifier/HTMLPurifier/Node/Element.php | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Element.php (limited to 'inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Element.php') diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Element.php b/inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Element.php new file mode 100644 index 00000000..7db4d025 --- /dev/null +++ b/inc/3rdparty/htmlpurifier/HTMLPurifier/Node/Element.php @@ -0,0 +1,59 @@ + form or the form, i.e. + * is it a pair of start/end tokens or an empty token. + * @bool + */ + public $empty = false; + + public $endCol = null, $endLine = null, $endArmor = array(); + + public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) { + $this->name = $name; + $this->attr = $attr; + $this->line = $line; + $this->col = $col; + $this->armor = $armor; + } + + public function toTokenPair() { + // XXX inefficiency here, normalization is not necessary + if ($this->empty) { + return array(new HTMLPurifier_Token_Empty($this->name, $this->attr, $this->line, $this->col, $this->armor), null); + } else { + $start = new HTMLPurifier_Token_Start($this->name, $this->attr, $this->line, $this->col, $this->armor); + $end = new HTMLPurifier_Token_End($this->name, array(), $this->endLine, $this->endCol, $this->endArmor); + //$end->start = $start; + return array($start, $end); + } + } +} + -- cgit v1.2.3