mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-17 10:51:38 +01:00
fix up HTML as it may mess up HTML-Content later on display, if tags are not propper
This commit is contained in:
parent
874989e242
commit
37a6917ae3
@ -252,7 +252,7 @@ class ajaxfelamimail
|
||||
} else {
|
||||
$this->sessionData['mimeType'] = 'text';
|
||||
$_content = str_replace(array("\r\n","\n","\r"),array("<br>","<br>","<br>"),$_content);
|
||||
$_content = $bocompose->_getCleanHTML($_content);
|
||||
$_content = $bocompose->_getCleanHTML($_content,false,false);
|
||||
$_content = $bocompose->convertHTMLToText($_content);
|
||||
}
|
||||
$htmlObject = html::fckEditorQuick('body', $_mode, $_content);
|
||||
|
@ -639,12 +639,12 @@
|
||||
$this->saveSessionData();
|
||||
}
|
||||
|
||||
static function _getCleanHTML($_body)
|
||||
static function _getCleanHTML($_body, $usepurify = false, $cleanTags=true)
|
||||
{
|
||||
static $nonDisplayAbleCharacters = array('[\016]','[\017]',
|
||||
'[\020]','[\021]','[\022]','[\023]','[\024]','[\025]','[\026]','[\027]',
|
||||
'[\030]','[\031]','[\032]','[\033]','[\034]','[\035]','[\036]','[\037]');
|
||||
bofelamimail::getCleanHTML($_body);
|
||||
bofelamimail::getCleanHTML($_body, $usepurify, $cleanTags);
|
||||
$_body = preg_replace($nonDisplayAbleCharacters, '', $_body);
|
||||
|
||||
return $_body;
|
||||
|
@ -824,7 +824,7 @@
|
||||
translation::replaceTagsCompletley($_body,$tag,$endtag,$addbracesforendtag);
|
||||
}
|
||||
|
||||
static function getCleanHTML(&$_html, $usepurify = false)
|
||||
static function getCleanHTML(&$_html, $usepurify = false, $cleanTags=true)
|
||||
{
|
||||
// remove CRLF and TAB as it is of no use in HTML.
|
||||
// but they matter in <pre>, so we rather don't
|
||||
@ -1101,6 +1101,8 @@
|
||||
$_html = preg_replace('/([\000-\012])/','',$_html);
|
||||
//error_log($_html);
|
||||
}
|
||||
// using purify above should have tidied the tags already sufficiently
|
||||
if ($usepurify == false && $cleanTags==true) $_html = html::purify($_html,html::purifyCreateHTMLTidyConfig());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user