PHPIDS | ||||
![]() | ||||
|
||||
![]() |
Coverage | ||||||||||||
Classes | Methods | Lines | ||||||||||
Total |
|
100.00% | 1 / 1 |
|
0.00% | 0 / 1 |
|
20.00% | 1 / 5 | |||
HTMLPurifier_AttrTransform_BgColor |
|
100.00% | 1 / 1 |
|
0.00% | 0 / 1 |
|
20.00% | 1 / 5 | |||
public function transform($attr, $config, $context) |
|
0.00% | 0 / 1 |
|
0.00% | 0 / 4 |
1 : <?php 2 : 3 : /** 4 : * Pre-transform that changes deprecated bgcolor attribute to CSS. 5 : */ 6 1 : class HTMLPurifier_AttrTransform_BgColor extends HTMLPurifier_AttrTransform { 7 : 8 : public function transform($attr, $config, $context) { 9 : 10 0 : if (!isset($attr['bgcolor'])) return $attr; 11 : 12 0 : $bgcolor = $this->confiscateAttr($attr, 'bgcolor'); 13 : // some validation should happen here 14 : 15 0 : $this->prependCSS($attr, "background-color:$bgcolor;"); 16 : 17 0 : return $attr; 18 : 19 : } 20 : 21 : } 22 : |
![]() |
Generated by PHPUnit 3.2.20 and Xdebug 2.0.3 at Sat Jun 7 16:15:42 CEST 2008. |