HTMLPurifier 4.4.0
/home/ezyang/Dev/htmlpurifier/library/HTMLPurifier/Token/Tag.php
Go to the documentation of this file.
00001 <?php
00002 
00006 class HTMLPurifier_Token_Tag extends HTMLPurifier_Token
00007 {
00014     public $is_tag = true;
00015 
00023     public $name;
00024 
00028     public $attr = array();
00029 
00036     public function __construct($name, $attr = array(), $line = null, $col = null, $armor = array()) {
00037         $this->name = ctype_lower($name) ? $name : strtolower($name);
00038         foreach ($attr as $key => $value) {
00039             // normalization only necessary when key is not lowercase
00040             if (!ctype_lower($key)) {
00041                 $new_key = strtolower($key);
00042                 if (!isset($attr[$new_key])) {
00043                     $attr[$new_key] = $attr[$key];
00044                 }
00045                 if ($new_key !== $key) {
00046                     unset($attr[$key]);
00047                 }
00048             }
00049         }
00050         $this->attr = $attr;
00051         $this->line = $line;
00052         $this->col  = $col;
00053         $this->armor = $armor;
00054     }
00055 }
00056 
00057 // vim: et sw=4 sts=4