mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-04 04:59:32 +01:00
* Mail: fix for messed up plain-text signature in some cases
This commit is contained in:
parent
106886756a
commit
eb05de40b4
@ -1557,7 +1557,14 @@ egw_LAB.wait(function() {
|
|||||||
*/
|
*/
|
||||||
static function splithtmlByPRE($html)
|
static function splithtmlByPRE($html)
|
||||||
{
|
{
|
||||||
if (($pos = stripos($html,'<pre ')) === false)
|
$searchFor = '<pre ';
|
||||||
|
$pos = stripos($html,$searchFor);
|
||||||
|
if ($pos===false)
|
||||||
|
{
|
||||||
|
$searchFor = '<pre>';
|
||||||
|
$pos = stripos($html,$searchFor);
|
||||||
|
}
|
||||||
|
if ($pos === false)
|
||||||
{
|
{
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
@ -1567,7 +1574,13 @@ egw_LAB.wait(function() {
|
|||||||
$endofpre = stripos($html,'</pre>',$pos);
|
$endofpre = stripos($html,'</pre>',$pos);
|
||||||
$length = $endofpre-$pos+6;
|
$length = $endofpre-$pos+6;
|
||||||
$html2ret[] = substr($html,$pos,$length);
|
$html2ret[] = substr($html,$pos,$length);
|
||||||
$pos = stripos($html,'<pre ', $endofpre+6);
|
$searchFor = '<pre ';
|
||||||
|
$pos = stripos($html,$searchFor, $endofpre+6);
|
||||||
|
if ($pos===false)
|
||||||
|
{
|
||||||
|
$searchFor = '<pre>';
|
||||||
|
$pos = stripos($html,$searchFor, $endofpre+6);
|
||||||
|
}
|
||||||
$html2ret[] = ($pos ? substr($html,$endofpre+6,$pos-($endofpre+6)): substr($html,$endofpre+6));
|
$html2ret[] = ($pos ? substr($html,$endofpre+6,$pos-($endofpre+6)): substr($html,$endofpre+6));
|
||||||
//$pos=false;
|
//$pos=false;
|
||||||
}
|
}
|
||||||
|
@ -1264,12 +1264,12 @@ class translation
|
|||||||
// removing carriage return linefeeds, preserve those enclosed in <pre> </pre> tags
|
// removing carriage return linefeeds, preserve those enclosed in <pre> </pre> tags
|
||||||
if ($stripcrl === true )
|
if ($stripcrl === true )
|
||||||
{
|
{
|
||||||
if (stripos($_html,'<pre ')!==false)
|
if (stripos($_html,'<pre ')!==false || stripos($_html,'<pre>')!==false)
|
||||||
{
|
{
|
||||||
$contentArr = html::splithtmlByPRE($_html);
|
$contentArr = html::splithtmlByPRE($_html);
|
||||||
foreach ($contentArr as $k =>&$elem)
|
foreach ($contentArr as $k =>&$elem)
|
||||||
{
|
{
|
||||||
if (stripos($elem,'<pre ')===false)
|
if (stripos($elem,'<pre ')===false && stripos($elem,'<pre>')===false)
|
||||||
{
|
{
|
||||||
//$elem = str_replace('@(\r\n)@i',' ',$elem);
|
//$elem = str_replace('@(\r\n)@i',' ',$elem);
|
||||||
$elem = str_replace(array("\r\n","\n"),($isHTML?'':' '),$elem);
|
$elem = str_replace(array("\r\n","\n"),($isHTML?'':' '),$elem);
|
||||||
@ -1326,12 +1326,12 @@ class translation
|
|||||||
// reducing double \r\n to single ones, dont mess with pre sections
|
// reducing double \r\n to single ones, dont mess with pre sections
|
||||||
if ($stripcrl === true && $isHTML)
|
if ($stripcrl === true && $isHTML)
|
||||||
{
|
{
|
||||||
if (stripos($_html,'<pre ')!==false)
|
if (stripos($_html,'<pre ')!==false || stripos($_html,'<pre>')!==false)
|
||||||
{
|
{
|
||||||
$contentArr = html::splithtmlByPRE($_html);
|
$contentArr = html::splithtmlByPRE($_html);
|
||||||
foreach ($contentArr as $k =>&$elem)
|
foreach ($contentArr as $k =>&$elem)
|
||||||
{
|
{
|
||||||
if (stripos($elem,'<pre ')===false)
|
if (stripos($elem,'<pre ')===false && stripos($elem,'<pre>')===false)
|
||||||
{
|
{
|
||||||
//this is supposed to strip out all remaining stuff in tags, this is sometimes taking out whole sections off content
|
//this is supposed to strip out all remaining stuff in tags, this is sometimes taking out whole sections off content
|
||||||
if ( $stripalltags ) {
|
if ( $stripalltags ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user