Changeset b575fa9 in github
- Timestamp:
- Mar 18, 2010 6:01:28 AM (3 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 1845fb6
- Parents:
- 98c489e
- Files:
-
- 2 edited
-
CHANGELOG (modified) (1 diff)
-
program/steps/mail/compose.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
r98c489e rb575fa9 2 2 =========================== 3 3 4 - Fix blocked.gif attachment is not attached to the message (#1486516) 4 5 - Managesieve: import from Horde-INGO 5 6 - Managesieve: support for more than one match (#1486078) -
program/steps/mail/compose.inc
rc16986b rb575fa9 476 476 $plugin = $RCMAIL->plugins->exec_hook('message_compose_body', 477 477 array('body' => $body, 'html' => $isHtml, 'mode' => $compose_mode)); 478 $body = $plugin['body']; 479 478 $body = $plugin['body']; 479 unset($plugin); 480 481 // add blocked.gif attachment (#1486516) 482 if ($isHtml && preg_match('#<img src="\./program/blocked\.gif"#', $body)) { 483 if ($attachment = rcmail_save_image('program/blocked.gif', 'image/gif')) { 484 $_SESSION['compose']['attachments'][$attachment['id']] = $attachment; 485 $body = preg_replace('#\./program/blocked\.gif#', 486 $RCMAIL->comm_path.'&_action=display-attachment&_file=rcmfile'.$attachment['id'], 487 $body); 488 } 489 } 490 480 491 $out = $form_start ? "$form_start\n" : ''; 481 492 … … 780 791 } 781 792 793 function rcmail_save_image($path, $mimetype='') 794 { 795 // handle attachments in memory 796 $data = file_get_contents($path); 797 798 $attachment = array( 799 'name' => rcmail_basename($path), 800 'mimetype' => $mimetype ? $mimetype : rc_mime_content_type($path, $name), 801 'data' => $data, 802 'size' => strlen($data), 803 ); 804 805 $attachment = rcmail::get_instance()->plugins->exec_hook('save_attachment', $attachment); 806 807 if ($attachment['status']) { 808 unset($attachment['data'], $attachment['status'], $attachment['content_id'], $attachment['abort']); 809 return $attachment; 810 } 811 812 return false; 813 } 814 815 function rcmail_basename($filename) 816 { 817 // basename() is not unicode safe and locale dependent 818 if (stristr(PHP_OS, 'win') || stristr(PHP_OS, 'netware')) { 819 return preg_replace('/^.*[\\\\\\/]/', '', $filename); 820 } else { 821 return preg_replace('/^.*[\/]/', '', $filename); 822 } 823 } 782 824 783 825 function rcmail_compose_subject($attrib)
Note: See TracChangeset
for help on using the changeset viewer.
