4 * Class for handling width/height length attribute transformations to CSS
6 class HTMLPurifier_AttrTransform_Length extends HTMLPurifier_AttrTransform
12 public function __construct($name, $css_name = null) {
14 $this->cssName = $css_name ? $css_name : $name;
17 public function transform($attr, $config, $context) {
18 if (!isset($attr[$this->name])) return $attr;
19 $length = $this->confiscateAttr($attr, $this->name);
20 if(ctype_digit($length)) $length .= 'px';
21 $this->prependCSS($attr, $this->cssName . ":$length;");