/lib/common.lib.php
html_purifier 함수에 추가
$config->set('Attr.AllowedFrameTargets', array('_blank'));
//유튜브, 비메오 전체화면 가능하게 하기
$config->set('Filter.Custom', array(new HTMLPurifier_Filter_Iframevideo()));
==> 여기부터 추가
$def = $config->getHTMLDefinition(true);
// Add usemap attribute to img tag
$def->addAttribute('img', 'usemap', 'CDATA');
// Add map tag
$map = $def->addElement(
'map', // name
'Block', // content set
'Flow', // allowed children
'Common', // attribute collection
array(// attributes
'name' => 'CDATA',
'id' => 'ID',
'title' => 'CDATA',
)
);
$map->excludes = array('map' => true);
// Add area tag
$area = $def->addElement(
'area', // name
'Block', // content set
'Empty', // don't allow children
'Common', // attribute collection
array(// attributes
'name' => 'CDATA',
'id' => 'ID',
'alt' => 'Text',
'coords' => 'CDATA',
'accesskey' => 'Character',
'nohref' => new HTMLPurifier_AttrDef_Enum(array('nohref')),
'href' => 'URI',
'shape' => new HTMLPurifier_AttrDef_Enum(array('rect', 'circle', 'poly', 'default')),
'tabindex' => 'Number',
'target' => new HTMLPurifier_AttrDef_Enum(array('_blank', '_self', '_target', '_top'))
)
);
$area->excludes = array('area' => true);
===> 여기까지
$purifier = new HTMLPurifier($config);
return $purifier->purify($html);