Changeset 4077 in subversion
- Timestamp:
- Oct 12, 2010 4:56:46 AM (3 years ago)
- Location:
- trunk/roundcubemail/program/steps/mail
- Files:
-
- 2 edited
-
compose.inc (modified) (3 diffs)
-
func.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/program/steps/mail/compose.inc
r4059 r4077 538 538 } 539 539 else { 540 $body = rcmail_plain_body($MESSAGE->first_text_part()); 540 $body = $MESSAGE->first_text_part(); 541 // try to remove the signature 542 if ($RCMAIL->config->get('strip_existing_sig', true)) 543 $body = rcmail_remove_signature($body); 544 // add HTML formatting 545 $body = rcmail_plain_body($body); 541 546 if ($body) 542 547 $body = '<pre>' . $body . '</pre>'; … … 711 716 712 717 // try to remove the signature 713 if ($RCMAIL->config->get('strip_existing_sig', true)) { 714 $len = strlen($body); 715 while (($sp = strrpos($body, "-- \n", $sp ? -$len+$sp-1 : 0)) !== false) { 716 if ($sp == 0 || $body[$sp-1] == "\n") { 717 // do not touch blocks with more that X lines 718 if (substr_count($body, "\n", $sp) < $RCMAIL->config->get('sig_max_lines', 15)) { 719 $body = substr($body, 0, max(0, $sp-1)); 720 } 721 break; 722 } 723 } 724 } 718 if ($RCMAIL->config->get('strip_existing_sig', true)) 719 $body = rcmail_remove_signature($body); 725 720 726 721 // soft-wrap and quote message text … … 836 831 return $body; 837 832 } 838 839 833 834 835 function rcmail_remove_signature($body) 836 { 837 global $RCMAIL; 838 839 $len = strlen($body); 840 $sig_max_lines = $RCMAIL->config->get('sig_max_lines', 15); 841 842 while (($sp = strrpos($body, "-- \n", $sp ? -$len+$sp-1 : 0)) !== false) { 843 if ($sp == 0 || $body[$sp-1] == "\n") { 844 // do not touch blocks with more that X lines 845 if (substr_count($body, "\n", $sp) < $sig_max_lines) { 846 $body = substr($body, 0, max(0, $sp-1)); 847 } 848 break; 849 } 850 } 851 852 return $body; 853 } 854 855 840 856 function rcmail_write_compose_attachments(&$message, $bodyIsHtml) 841 857 { -
trunk/roundcubemail/program/steps/mail/func.inc
r4063 r4077 844 844 $body = Q(join("\n", $a_lines), 'dummy', false); 845 845 846 // colorize signature 846 // colorize signature (up to <sig_max_lines> lines) 847 847 $len = strlen($body); 848 $sig_max_lines = $RCMAIL->config->get('sig_max_lines', 15); 848 849 while (($sp = strrpos($body, "-- \n", $sp ? -$len+$sp-1 : 0)) !== false) { 849 850 if ($sp == 0 || $body[$sp-1] == "\n") { 850 851 // do not touch blocks with more that X lines 851 if (substr_count($body, "\n", $sp) < $ RCMAIL->config->get('sig_max_lines', 15))852 if (substr_count($body, "\n", $sp) < $sig_max_lines) 852 853 $body = substr($body, 0, max(0, $sp)) 853 854 .'<span class="sig">'.substr($body, $sp).'</span>';
Note: See TracChangeset
for help on using the changeset viewer.
