Changeset 3963 in subversion
- Timestamp:
- Sep 14, 2010 5:53:53 AM (3 years ago)
- Location:
- trunk/roundcubemail/program/steps/mail
- Files:
-
- 2 edited
-
compose.inc (modified) (1 diff)
-
func.inc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/mail/compose.inc
r3949 r3963 611 611 612 612 if (!$bodyIsHtml) { 613 $body = preg_replace('/\r?\n/', "\n", $body); 614 613 615 // try to remove the signature 614 if ($RCMAIL->config->get('strip_existing_sig', true) && ($sp = strrpos($body, '-- ')) !== false && ($sp == 0 || $body{$sp-1} == "\n")) { 615 if ($body{$sp+3}==' ' || $body{$sp+3}=="\n" || $body{$sp+3}=="\r") 616 $body = substr($body, 0, max(0, $sp-1)); 616 if ($RCMAIL->config->get('strip_existing_sig', true)) { 617 $len = strlen($body); 618 while (($sp = strrpos($body, "-- \n", $sp ? -$len+$sp-1 : 0)) !== false) { 619 if ($sp == 0 || $body[$sp-1] == "\n") { 620 // do not touch blocks with more that X lines 621 if (substr_count($body, "\n", $sp) < $RCMAIL->config->get('sig_max_lines', 15)) { 622 $body = substr($body, 0, max(0, $sp-1)); 623 } 624 break; 625 } 626 } 617 627 } 618 628 619 629 // soft-wrap and quote message text 620 $body = rcmail_wrap_and_quote(rtrim($body, "\ r\n"), $LINE_LENGTH);630 $body = rcmail_wrap_and_quote(rtrim($body, "\n"), $LINE_LENGTH); 621 631 622 632 // add title line(s) -
trunk/roundcubemail/program/steps/mail/func.inc
r3962 r3963 755 755 function rcmail_plain_body($body, $flowed=false) 756 756 { 757 global $RCMAIL; 758 757 759 // make links and email-addresses clickable 758 760 $replacer = new rcube_string_replacer; … … 781 783 else if ($flowed) { 782 784 // previous line is flowed 783 if (isset($a_lines[$last]) 785 if (isset($a_lines[$last]) && $a_lines[$n] 784 786 && $a_lines[$last][strlen($a_lines[$last])-1] == ' ') { 785 // merge lines (and remove space-stuffing)787 // merge lines 786 788 $a_lines[$last] .= $a_lines[$n]; 787 789 unset($a_lines[$n]); … … 804 806 805 807 // previous line is flowed? 806 if (isset($a_lines[$last]) 808 if (isset($a_lines[$last]) && $a_lines[$n] 807 809 && $a_lines[$last] != '-- ' 808 810 && $a_lines[$last][strlen($a_lines[$last])-1] == ' ' … … 831 833 832 834 // colorize signature 833 if (($sp = strrpos($body, "-- \n")) !== false) { 834 if (($sp == 0 || $body[$sp-1] == "\n")) { 835 // do not touch blocks with more that 10 lines 836 if (substr_count($body, "\n", $sp) < 10) 835 $len = strlen($body); 836 while (($sp = strrpos($body, "-- \n", $sp ? -$len+$sp-1 : 0)) !== false) { 837 if ($sp == 0 || $body[$sp-1] == "\n") { 838 // do not touch blocks with more that X lines 839 if (substr_count($body, "\n", $sp) < $RCMAIL->config->get('sig_max_lines', 15)) 837 840 $body = substr($body, 0, max(0, $sp)) 838 841 .'<span class="sig">'.substr($body, $sp).'</span>'; 842 break; 839 843 } 840 844 }
Note: See TracChangeset
for help on using the changeset viewer.
