mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-24 00:43:20 +01:00
* eMail: handle excess linebreaks in signatures when compose as plainText (when using div for linebreak mode for ck-editor)
This commit is contained in:
parent
e26f5216a6
commit
fdd5ee3da3
@ -1493,8 +1493,8 @@ class ajaxfelamimail
|
||||
//error_log(__METHOD__.'New:'.$sigText.'#');
|
||||
if ($_currentMode == 'plain')
|
||||
{
|
||||
$oldSigText = utf8_decode($bocompose->convertHTMLToText($oldSigText));
|
||||
$sigText = utf8_decode($bocompose->convertHTMLToText($sigText));
|
||||
$oldSigText = utf8_decode($bocompose->convertHTMLToText($oldSigText,true,true));
|
||||
$sigText = utf8_decode($bocompose->convertHTMLToText($sigText,true,true));
|
||||
$_content = utf8_decode($_content);
|
||||
if($this->_debug) error_log(__METHOD__." Old signature:".$oldSigText);
|
||||
}
|
||||
@ -1537,7 +1537,7 @@ class ajaxfelamimail
|
||||
$found = strpos($_content,trim($oldSigText));
|
||||
}
|
||||
|
||||
if ($found !== false && $_oldSig != -2 && !(empty($oldSigText) || trim($bocompose->convertHTMLToText($oldSigText)) ==''))
|
||||
if ($found !== false && $_oldSig != -2 && !(empty($oldSigText) || trim($bocompose->convertHTMLToText($oldSigText,true,true)) ==''))
|
||||
{
|
||||
//error_log(__METHOD__.'Old Content:'.$_content.'#');
|
||||
$_oldSigText = preg_quote($oldSigText,'~');
|
||||
@ -1546,7 +1546,7 @@ class ajaxfelamimail
|
||||
//error_log(__METHOD__.'new Content:'.$_content.'#');
|
||||
}
|
||||
|
||||
if ($_oldSig == -2 && (empty($oldSigText) || trim($bocompose->convertHTMLToText($oldSigText)) ==''))
|
||||
if ($_oldSig == -2 && (empty($oldSigText) || trim($bocompose->convertHTMLToText($oldSigText,true,true)) ==''))
|
||||
{
|
||||
// if there is no sig selected, there is no way to replace a signature
|
||||
}
|
||||
|
@ -141,12 +141,12 @@
|
||||
return 1;
|
||||
}
|
||||
|
||||
function convertHTMLToText(&$_html,$sourceishtml = true)
|
||||
function convertHTMLToText(&$_html,$sourceishtml = true, $stripcrl=false)
|
||||
{
|
||||
$stripalltags = true;
|
||||
// third param is stripalltags, we may not need that, if the source is already in ascii
|
||||
if (!$sourceishtml) $stripalltags=false;
|
||||
return felamimail_bo::convertHTMLToText($_html,false,$stripalltags);
|
||||
return felamimail_bo::convertHTMLToText($_html,$stripcrl,$stripalltags);
|
||||
}
|
||||
|
||||
function convertHTMLToTextTiny($_html)
|
||||
@ -828,9 +828,9 @@
|
||||
($disableRuler ?'<br>':'<hr style="border:1px dotted silver; width:90%;">').
|
||||
$signature;
|
||||
}
|
||||
$_mailObject->AltBody = $this->convertHTMLToText($_formData['body']).
|
||||
$_mailObject->AltBody = $this->convertHTMLToText($_formData['body'],true,true).
|
||||
($disableRuler ?"\r\n":"\r\n-- \r\n").
|
||||
$this->convertHTMLToText($signature);
|
||||
$this->convertHTMLToText($signature,true,true);
|
||||
#print "<pre>$_mailObject->AltBody</pre>";
|
||||
#print htmlentities($_signature['signature']);
|
||||
} else {
|
||||
@ -840,7 +840,7 @@
|
||||
} else {
|
||||
$_mailObject->Body = $_formData['body'];
|
||||
}
|
||||
$_mailObject->AltBody = $this->convertHTMLToText($_formData['body']);
|
||||
$_mailObject->AltBody = $this->convertHTMLToText($_formData['body'],true,true);
|
||||
}
|
||||
// convert URL Images to inline images - if possible
|
||||
if ($_convertLinks) felamimail_bo::processURL2InlineImages($_mailObject, $_mailObject->Body);
|
||||
@ -854,7 +854,7 @@
|
||||
#$_mailObject->Body = $_formData['body'];
|
||||
if(!empty($signature)) {
|
||||
$_mailObject->Body .= ($disableRuler ?"\r\n":"\r\n-- \r\n").
|
||||
$this->convertHTMLToText($signature);
|
||||
$this->convertHTMLToText($signature,true,true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -782,7 +782,7 @@
|
||||
$signature = $boSignatures->getSignature(($presetSig ? $presetSig : $sessionData['signatureID']));
|
||||
if ((isset($this->bocompose->preferencesArray['disableRulerForSignatureSeparation']) &&
|
||||
$this->bocompose->preferencesArray['disableRulerForSignatureSeparation']) ||
|
||||
empty($signature->fm_signature) || trim($this->bocompose->convertHTMLToText($signature->fm_signature)) =='')
|
||||
empty($signature->fm_signature) || trim($this->bocompose->convertHTMLToText($signature->fm_signature,true,true)) =='')
|
||||
{
|
||||
$disableRuler = true;
|
||||
}
|
||||
@ -828,11 +828,11 @@
|
||||
|
||||
if ($insertSigOnTop === 'below')
|
||||
{
|
||||
$sessionData['body'] = $font_span.$sessionData['body'].$before.($sessionData['mimeType'] == 'html'?$sigText:$this->bocompose->convertHTMLToText($sigText));
|
||||
$sessionData['body'] = $font_span.$sessionData['body'].$before.($sessionData['mimeType'] == 'html'?$sigText:$this->bocompose->convertHTMLToText($sigText,true,true));
|
||||
}
|
||||
else
|
||||
{
|
||||
$sessionData['body'] = $before.($sessionData['mimeType'] == 'html'?$sigText:$this->bocompose->convertHTMLToText($sigText)).$inbetween.$sessionData['body'];
|
||||
$sessionData['body'] = $before.($sessionData['mimeType'] == 'html'?$sigText:$this->bocompose->convertHTMLToText($sigText,true,true)).$inbetween.$sessionData['body'];
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user