mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
20 lines
378 B
PHP
20 lines
378 B
PHP
<?php
|
|
|
|
namespace SilverStripe\View\Parsers;
|
|
|
|
use HTMLPurifier;
|
|
|
|
/**
|
|
* Cleans HTML using the HTMLPurifier package
|
|
* http://htmlpurifier.org/
|
|
*/
|
|
class PurifierHTMLCleaner extends HTMLCleaner
|
|
{
|
|
public function cleanHTML($content)
|
|
{
|
|
$html = new HTMLPurifier();
|
|
$doc = HTMLValue::create($html->purify($content));
|
|
return $doc->getContent();
|
|
}
|
|
}
|