File indexing completed on 2024-12-22 05:36:22

0001 <?php
0002 
0003 /**
0004  * Defines a mutation of an obsolete tag into a valid tag.
0005  */
0006 abstract class HTMLPurifier_TagTransform
0007 {
0008 
0009     /**
0010      * Tag name to transform the tag to.
0011      * @type string
0012      */
0013     public $transform_to;
0014 
0015     /**
0016      * Transforms the obsolete tag into the valid tag.
0017      * @param HTMLPurifier_Token_Tag $tag Tag to be transformed.
0018      * @param HTMLPurifier_Config $config Mandatory HTMLPurifier_Config object
0019      * @param HTMLPurifier_Context $context Mandatory HTMLPurifier_Context object
0020      */
0021     abstract public function transform($tag, $config, $context);
0022 
0023     /**
0024      * Prepends CSS properties to the style attribute, creating the
0025      * attribute if it doesn't exist.
0026      * @warning Copied over from AttrTransform, be sure to keep in sync
0027      * @param array $attr Attribute array to process (passed by reference)
0028      * @param string $css CSS to prepend
0029      */
0030     protected function prependCSS(&$attr, $css)
0031     {
0032         $attr['style'] = isset($attr['style']) ? $attr['style'] : '';
0033         $attr['style'] = $css . $attr['style'];
0034     }
0035 }
0036 
0037 // vim: et sw=4 sts=4