Changeset 99f2b31 in github
- Timestamp:
- Dec 29, 2008 7:32:16 AM (4 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- a1733f0
- Parents:
- 17060ee
- File:
-
- 1 edited
-
program/steps/mail/sendmail.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
program/steps/mail/sendmail.inc
r4e74d2c r99f2b31 99 99 100 100 $last_img_pos = 0; 101 102 101 $searchstr = 'program/js/tiny_mce/plugins/emotions/img/'; 102 $path_len = strlen(INSTALL_PATH . '/'); 103 103 104 104 // keep track of added images, so they're only added once … … 110 110 $pos2 = strpos($body, '"', $pos); 111 111 $body_pre = substr($body, 0, $pos); 112 $body_post = substr($body, $pos2); 113 112 114 $image_name = substr($body, 113 115 $pos + strlen($searchstr), 114 116 $pos2 - ($pos + strlen($searchstr))); 117 115 118 // sanitize image name so resulting attachment doesn't leave images dir 116 119 $image_name = preg_replace('/[^a-zA-Z0-9_\.\-]/i','',$image_name); 117 118 $body_post = substr($body, $pos2); 120 $img_file = INSTALL_PATH . '/' . $searchstr . $image_name; 119 121 120 122 if (! in_array($image_name, $included_images)) 121 123 { 122 124 // add the image to the MIME message 123 $img_file = INSTALL_PATH . '/' . $searchstr . $image_name;124 125 if(! $mime_message->addHTMLImage($img_file, 'image/gif', '', true, $image_name)) 125 126 $OUTPUT->show_message("emoticonerror", 'error'); 126 127 127 array_push($included_images, $image_name); 128 128 } 129 129 130 130 $body = $body_pre . $img_file . $body_post; 131 131 132 $last_img_pos = $pos2 ;133 } 134 132 $last_img_pos = $pos2 + $path_len; 133 } 134 135 135 $mime_message->setHTMLBody($body); 136 136 }
Note: See TracChangeset
for help on using the changeset viewer.
