Ticket #1484506: bug-1484506-fix.patch

File bug-1484506-fix.patch, 1.0 kB (added by tvk, 12 months ago)

patch to fix this, against r921

  • roundcubemail/program/steps/mail/sendmail.inc

     
    253253  // add a plain text version of the e-mail as an alternative part. 
    254254  $h2t = new html2text($message_body); 
    255255  $plainTextPart = wordwrap($h2t->get_text(), 998, "\r\n", true); 
     256  if (!strlen($plainTextPart)) 
     257  { 
     258      // empty message body breaks attachment handling in drafts 
     259                $plainTextPart = "\r\n"; 
     260  } 
     261 
    256262  $MAIL_MIME->setTXTBody($plainTextPart); 
    257263 
    258264  // look for "emoticon" images from TinyMCE and copy into message as attachments 
     
    262268  { 
    263269  $message_body = wordwrap($message_body, 75, "\r\n"); 
    264270  $message_body = wordwrap($message_body, 998, "\r\n", true); 
     271   
     272  if (!strlen($message_body))  
     273  { 
     274         // empty message body breaks attachment handling in drafts 
     275         $message_body = "\r\n"; 
     276  } 
     277 
    265278  $MAIL_MIME->setTXTBody($message_body, FALSE, TRUE); 
    266279  } 
    267280