diff options
author | Aleksander Machniak <alec@alec.pl> | 2015-02-19 10:25:38 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2015-02-19 10:25:38 +0100 |
commit | 50b04366ee7472272e2576d17c609e1d26345221 (patch) | |
tree | 7cdd9dfa14f47487c0ea2c4b9d6d73ecd1067f97 /program/steps | |
parent | 81d4ff214e7cf2253c270a8f8de533bebbf88c15 (diff) | |
parent | 3665d1e8ece98ea2093d464087b2cd856df73bd6 (diff) |
Merge branch 'master' of github.com:roundcube/roundcubemail
Conflicts:
CHANGELOG
Diffstat (limited to 'program/steps')
-rw-r--r-- | program/steps/mail/sendmail.inc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index 715ee32cf..5843de43f 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -765,8 +765,10 @@ function rcmail_fix_emoticon_paths($mime_message) // remove any null-byte characters before parsing $body = preg_replace('/\x00/', '', $body); - $searchstr = 'program/js/tinymce/plugins/emoticons/img/'; - $offset = 0; + $searchstr = 'program/js/tinymce/plugins/emoticons/img/'; + $assets_dir = $RCMAIL->config->get('assets_dir'); + $path = ($assets_dir ?: INSTALL_PATH) . '/' . $searchstr; + $offset = 0; // keep track of added images, so they're only added once $included_images = array(); @@ -779,12 +781,14 @@ function rcmail_fix_emoticon_paths($mime_message) // sanitize image name so resulting attachment doesn't leave images dir $image_name = preg_replace('/[^a-zA-Z0-9_\.\-]/i', '', $image_name); - $img_file = INSTALL_PATH . '/' . $searchstr . $image_name; + $img_file = $path . $image_name; - if (! in_array($image_name, $included_images)) { + if (!in_array($image_name, $included_images)) { // add the image to the MIME message - if (!$mime_message->addHTMLImage($img_file, 'image/gif', '', true, $image_name)) { + $res = $mime_message->addHTMLImage($img_file, 'image/gif', '', true, $image_name); + if (PEAR::isError($res)) { $RCMAIL->output->show_message("emoticonerror", 'error'); + continue; } array_push($included_images, $image_name); |