Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / lib / htmlpurifier / HTMLPurifier / AttrTransform / Border.php
blob7da4f6a8041a7d8710802273316b86b4cdabfc0c
1 <?php
3 require_once 'HTMLPurifier/AttrTransform.php';
5 /**
6 * Pre-transform that changes deprecated border attribute to CSS.
7 */
8 class HTMLPurifier_AttrTransform_Border extends HTMLPurifier_AttrTransform {
10 function transform($attr, $config, &$context) {
11 if (!isset($attr['border'])) return $attr;
12 $border_width = $this->confiscateAttr($attr, 'border');
13 // some validation should happen here
14 $this->prependCSS($attr, "border:{$border_width}px solid;");
15 return $attr;