Вот пример кода:
Код: Выделить всё
require_once 'ezyang/htmlpurifier/library/HTMLPurifier.auto.php';
$config = HTMLPurifier_Config::createDefault();
$purifier = new HTMLPurifier($config);
$dirty_html = ' How configure HTMLPurifier to prevent sanitize of Inline-style Attribute ? ';
// I want to prevent any change done by purify on style Attribute values
$clean_html = $purifier->purify($dirty_html);
// But in $clean_html div style value becomes: style="background-color:rgb(0,240,240);"
echo $clean_html;

Как настроить HTMLPurifier, чтобы пропустить очистку атрибута стиля?
Подробнее здесь: https://stackoverflow.com/questions/792 ... -attribute
Мобильная версия