friendica/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/Name.php

27 lines
669 B
PHP
Raw Normal View History

2010-09-09 03:14:17 +00:00
<?php
class HTMLPurifier_HTMLModule_Name extends HTMLPurifier_HTMLModule
{
2016-02-09 10:06:17 +00:00
/**
* @type string
*/
2010-09-09 03:14:17 +00:00
public $name = 'Name';
2016-02-09 10:06:17 +00:00
/**
* @param HTMLPurifier_Config $config
*/
public function setup($config)
{
2010-09-09 03:14:17 +00:00
$elements = array('a', 'applet', 'form', 'frame', 'iframe', 'img', 'map');
foreach ($elements as $name) {
$element = $this->addBlankElement($name);
$element->attr['name'] = 'CDATA';
if (!$config->get('HTML.Attr.Name.UseCDATA')) {
2016-02-09 10:06:17 +00:00
$element->attr_transform_post[] = new HTMLPurifier_AttrTransform_NameSync();
2010-09-09 03:14:17 +00:00
}
}
}
}
// vim: et sw=4 sts=4