Test Failed
Push — develop ( ff58ad...b8f9b2 )
by steve
13:44 queued 12s
created

HtmlPurifier::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 8
rs 10
c 2
b 0
f 1
1
<?php
2
3
namespace neon\core\helpers;
4
5
use HTMLPurifier_Config;
6
use yii\helpers\BaseHtmlPurifier;
7
8
class HtmlPurifier extends BaseHtmlPurifier
9
{
10
	/**
11
	 * Extend config for processing
12
	 *
13
	 * @param HTMLPurifier_Config $config
14
	 */
15
	protected static function configure($config)
16
	{
17
		parent::configure($config);
18
		$def = $config->getHTMLDefinition(true);
19
		$def->addAttribute('a', 'target', 'Text');
20
		$def->addAttribute('img', 'srcset', 'Text');
21
		$def->addAttribute('img', 'sizes', 'Text');
22
		$def->addAttribute('img', 'loading', 'Text');
23
	}
24
}