4 * Class for handling width/height length attribute transformations to CSS
6 class HTMLPurifier_AttrTransform_Length
extends HTMLPurifier_AttrTransform
19 public function __construct($name, $css_name = null)
22 $this->cssName
= $css_name ?
$css_name : $name;
27 * @param HTMLPurifier_Config $config
28 * @param HTMLPurifier_Context $context
31 public function transform($attr, $config, $context)
33 if (!isset($attr[$this->name
])) {
36 $length = $this->confiscateAttr($attr, $this->name
);
37 if (ctype_digit($length)) {
40 $this->prependCSS($attr, $this->cssName
. ":$length;");