Aleksander Machniak
2012-08-15 21d463babac32ced33dd93850ca7d29efd43cde6
Fix stripped apostrophes when replying in plain text to HTML message (#1488606)
3 files modified
14 ■■■■ changed files
CHANGELOG 1 ●●●● patch | view | raw | blame | history
program/lib/html2text.php 2 ●●● patch | view | raw | blame | history
program/steps/mail/sendmail.inc 11 ●●●●● patch | view | raw | blame | history
CHANGELOG
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================
- Fix stripped apostrophes when replying in plain text to HTML message (#1488606)
- Fix inactive Save search option after advanced search (#1488607)
- Fix Remove from group option is active for contact search result (#1488608)
- Disable autocapitalization in login form on iPad/iPhone (#1488609)
program/lib/html2text.php
@@ -515,7 +515,7 @@
        $text = preg_replace($this->ent_search, $this->ent_replace, $text);
        // Replace known html entities
        $text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
        $text = html_entity_decode($text, ENT_QUOTES, 'UTF-8');
        // Remove unknown/unhandled entities (this cannot be done in search-and-replace block)
        $text = preg_replace('/&([a-zA-Z0-9]{2,6}|#[0-9]{2,4});/', '', $text);
program/steps/mail/sendmail.inc
@@ -511,14 +511,9 @@
  $h2t = new html2text($plugin['body'], false, true, 0);
  $plainTextPart = rc_wordwrap($h2t->get_text(), $LINE_LENGTH, "\r\n");
  $plainTextPart = wordwrap($plainTextPart, 998, "\r\n", true);
  if (!$plainTextPart) {
    // empty message body breaks attachment handling in drafts
    $plainTextPart = "\r\n";
  }
  else {
    // make sure all line endings are CRLF (#1486712)
    $plainTextPart = preg_replace('/\r?\n/', "\r\n", $plainTextPart);
  }
  $plugin = $RCMAIL->plugins->exec_hook('message_outgoing_body',
    array('body' => $plainTextPart, 'type' => 'alternative', 'message' => $MAIL_MIME));
@@ -542,10 +537,6 @@
    $message_body = rc_wordwrap($message_body, $LINE_LENGTH, "\r\n");
  $message_body = wordwrap($message_body, 998, "\r\n", true);
  if (!strlen($message_body)) {
    // empty message body breaks attachment handling in drafts
    $message_body = "\r\n";
  }
  $MAIL_MIME->setTXTBody($message_body, false, true);
}