mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-27 16:29:22 +01:00
* Mail: fix forwarding and reply to mail with just a PDF or image was showing it and not opening a compose window
This commit is contained in:
parent
76793ac1b7
commit
2ed34a39c6
@ -4961,9 +4961,11 @@ class Mail
|
|||||||
* @param boolean $_preserveSeen flag to preserve the seenflag by using body.peek
|
* @param boolean $_preserveSeen flag to preserve the seenflag by using body.peek
|
||||||
* @param string $_folder folder to work on
|
* @param string $_folder folder to work on
|
||||||
* @param Horde_Mime_part& $calendar_part =null on return calendar-part or null, if there is none
|
* @param Horde_Mime_part& $calendar_part =null on return calendar-part or null, if there is none
|
||||||
|
* @param bool $output_no_body true: if we have no "real" body, but a PDF or image, output it to display, false: return empty body
|
||||||
* @return array containing the message body, mimeType and charset
|
* @return array containing the message body, mimeType and charset
|
||||||
*/
|
*/
|
||||||
function getMessageBody($_uid, $_htmlOptions='', $_partID=null, Horde_Mime_Part $_structure=null, $_preserveSeen = false, $_folder = '', &$calendar_part=null)
|
function getMessageBody($_uid, $_htmlOptions='', $_partID=null, Horde_Mime_Part $_structure=null, $_preserveSeen = false,
|
||||||
|
$_folder = '', &$calendar_part=null, bool $output_no_body=true)
|
||||||
{
|
{
|
||||||
if (self::$debug) echo __METHOD__."$_uid, $_htmlOptions, $_partID<br>";
|
if (self::$debug) echo __METHOD__."$_uid, $_htmlOptions, $_partID<br>";
|
||||||
if($_htmlOptions != '') {
|
if($_htmlOptions != '') {
|
||||||
@ -5001,7 +5003,7 @@ class Mail
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if message is just a pdf, return it to browser to display
|
// if message is just a pdf, return it to browser to display
|
||||||
if ($_structure->getType() === 'application/pdf' || $_structure->getPrimaryType() === 'image')
|
if ($output_no_body && ($_structure->getType() === 'application/pdf' || $_structure->getPrimaryType() === 'image'))
|
||||||
{
|
{
|
||||||
header('Content-Type: '.$_structure->getType());
|
header('Content-Type: '.$_structure->getType());
|
||||||
echo $this->getAttachment($_uid, $_partID ?? '1', 0, true, $_folder)->getContents();
|
echo $this->getAttachment($_uid, $_partID ?? '1', 0, true, $_folder)->getContents();
|
||||||
|
@ -326,7 +326,7 @@ class mail_compose
|
|||||||
$_contentHasSigID = $_content?array_key_exists('mailidentity',(array)$_content):false;
|
$_contentHasSigID = $_content?array_key_exists('mailidentity',(array)$_content):false;
|
||||||
$_contentHasMimeType = $_content? array_key_exists('mimeType',(array)$_content):false;
|
$_contentHasMimeType = $_content? array_key_exists('mimeType',(array)$_content):false;
|
||||||
|
|
||||||
// fetch appendix data which is an assistance input value consisiting of json data
|
// fetch appendix data which is an assistance input value consisting of json data
|
||||||
if (!empty($_content['appendix_data']))
|
if (!empty($_content['appendix_data']))
|
||||||
{
|
{
|
||||||
$appendix_data = json_decode($_content['appendix_data'], true);
|
$appendix_data = json_decode($_content['appendix_data'], true);
|
||||||
@ -2283,7 +2283,8 @@ class mail_compose
|
|||||||
//_debug_array($headers);
|
//_debug_array($headers);
|
||||||
//error_log(__METHOD__.__LINE__.'->'.array2string($this->mailPreferences['htmlOptions']));
|
//error_log(__METHOD__.__LINE__.'->'.array2string($this->mailPreferences['htmlOptions']));
|
||||||
try {
|
try {
|
||||||
$bodyParts = $mail_bo->getMessageBody($_uid, ($this->mailPreferences['htmlOptions']?$this->mailPreferences['htmlOptions']:''), $_partID);
|
$bodyParts = $mail_bo->getMessageBody($_uid, $this->mailPreferences['htmlOptions']??'', $_partID,
|
||||||
|
null, false, '', $nul, false);
|
||||||
}
|
}
|
||||||
catch (Mail\Smime\PassphraseMissing $e)
|
catch (Mail\Smime\PassphraseMissing $e)
|
||||||
{
|
{
|
||||||
@ -2374,11 +2375,8 @@ class mail_compose
|
|||||||
$this->sessionData['body'] .= "\r\n";
|
$this->sessionData['body'] .= "\r\n";
|
||||||
$hasSignature = false;
|
$hasSignature = false;
|
||||||
// create body new, with good line breaks and indention
|
// create body new, with good line breaks and indention
|
||||||
foreach(explode("\n",$newBody) as $value) {
|
foreach($newBody ? explode("\n",$newBody) : [] as $value) {
|
||||||
// the explode is removing the character
|
// Try to remove signatures from quoted parts to avoid multiple
|
||||||
//$value .= 'ee';
|
|
||||||
|
|
||||||
// Try to remove signatures from qouted parts to avoid multiple
|
|
||||||
// signatures problem in reply (rfc3676#section-4.3).
|
// signatures problem in reply (rfc3676#section-4.3).
|
||||||
if ($_mode != 'forward' && ($hasSignature || ($hasSignature = preg_match("/^--\s[\r\n]$/",$value))))
|
if ($_mode != 'forward' && ($hasSignature || ($hasSignature = preg_match("/^--\s[\r\n]$/",$value))))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user