Changeset 1751 in subversion
- Timestamp:
- Sep 6, 2008 12:41:43 PM (5 years ago)
- Location:
- trunk/roundcubemail/program/steps/mail
- Files:
-
- 2 edited
-
compose.inc (modified) (3 diffs)
-
func.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/mail/compose.inc
r1747 r1751 33 33 { 34 34 @unlink($_SESSION['compose']['attachments'][$id]['path']); 35 $_SESSION['compose']['attachments'][$id] = NULL;35 unset($_SESSION['compose']['attachments'][$id]); 36 36 $OUTPUT->command('remove_from_attachment_list', "rcmfile$id"); 37 37 $OUTPUT->send(); … … 479 479 { 480 480 // soft-wrap message first 481 $body = wordwrap($body, 75);481 $body = rcmail_wrap_quoted($body, 75); 482 482 483 483 // split body into single lines … … 527 527 if (!$bodyIsHtml) 528 528 { 529 // soft-wrap message first530 $body = wordwrap($body, 80);531 532 529 $prefix = sprintf("\n\n\n-------- Original Message --------\nSubject: %s\nDate: %s\nFrom: %s\nTo: %s\n\n", 533 530 $MESSAGE->subject, -
trunk/roundcubemail/program/steps/mail/func.inc
r1739 r1751 643 643 $convert_replaces[] = "rcmail_str_replacement('<a href=\"mailto:\\1\" onclick=\"return ".JS_OBJECT_NAME.".command(\'compose\',\'\\1\',this)\">\\1</a>', \$replace_strings)"; 644 644 645 // if ($part->ctype_parameters['format'] != 'flowed')646 // $body = wordwrap(trim($body), 80);647 648 645 // search for patterns like links and e-mail addresses 649 646 $body = preg_replace($convert_patterns, $convert_replaces, $body); … … 1014 1011 1015 1012 1013 /** 1014 * Wrap text to a given number of characters per line 1015 * but respect the mail quotation of replies messages (>) 1016 * 1017 * @param string Text to wrap 1018 * @param int The line width 1019 * @return string The wrapped text 1020 */ 1021 function rcmail_wrap_quoted($text, $max = 76) 1022 { 1023 // Rebuild the message body with a maximum of $max chars, while keeping quoted message. 1024 $lines = preg_split('/\r?\n/', trim($text)); 1025 $out = ''; 1026 1027 foreach ($lines as $line) { 1028 if (strlen($line) > $max) { 1029 if (preg_match('/^([>\s]+)/', $line, $regs)) { 1030 $length = strlen($regs[0]); 1031 $prefix = substr($line, 0, $length); 1032 1033 // Remove '> ' from the line, then wordwrap() the line 1034 $line = wordwrap(substr($line, $length), $max - $length); 1035 1036 // Rebuild the line with '> ' at the beginning of each 'subline' 1037 $newline = ''; 1038 foreach (explode("\n", $line) as $l) { 1039 $newline .= $prefix . $l . "\n"; 1040 } 1041 1042 // Remove the righest newline char 1043 $line = rtrim($newline); 1044 } 1045 else { 1046 $line = wordwrap($line, $max); 1047 } 1048 } 1049 1050 // Append the line 1051 $out .= $line . "\n"; 1052 } 1053 1054 return $out; 1055 } 1056 1057 1016 1058 function rcmail_message_part_controls() 1017 1059 {
Note: See TracChangeset
for help on using the changeset viewer.
