mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-23 16:33:17 +01:00
for performance reasons, use tidy (if available) instead of htmlpurifier to fix html tags
This commit is contained in:
parent
02f53242d3
commit
e1cb220eb7
@ -1102,7 +1102,28 @@
|
||||
//error_log($_html);
|
||||
}
|
||||
// using purify above should have tidied the tags already sufficiently
|
||||
if ($usepurify == false && $cleanTags==true) $_html = html::purify($_html,html::purifyCreateHTMLTidyConfig());
|
||||
// using purify above should have tidied the tags already sufficiently
|
||||
if ($usepurify == false && $cleanTags==true)
|
||||
{
|
||||
if (extension_loaded('tidy'))
|
||||
{
|
||||
$tidy = new tidy();
|
||||
$cleaned = $tidy->repairString($_html, array('clean'=>true,'output-xhtml'=>true,'join-classes'=>true,'join-styles'=>true,'show-body-only'=>false,'word-2000'=>true,'wrap'=>0),'utf8');
|
||||
// Found errors. Strip it all so there's some output
|
||||
if($tidy->getStatus() == 2)
|
||||
{
|
||||
error_log(__METHOD__.__LINE__.' ->'.$tidy->errorBuffer);
|
||||
}
|
||||
else
|
||||
{
|
||||
$_html = $cleaned;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$_html = html::purify($_html,html::purifyCreateHTMLTidyConfig());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user