diff options
author | Mike Macgirvin <mike@macgirvin.com> | 2010-10-28 16:05:09 -0700 |
---|---|---|
committer | Mike Macgirvin <mike@macgirvin.com> | 2010-10-28 16:05:09 -0700 |
commit | a0f6f8ad533ee0ef89cee104d0d0ef1c0c54be7b (patch) | |
tree | ea0e29115182d47c97f3890fd2807aa881f8c405 /mod/dfrn_notify.php | |
parent | 42e6b6cfe4f0b2bd6a2e8361479cb813857ca0e6 (diff) | |
download | volse-hubzilla-a0f6f8ad533ee0ef89cee104d0d0ef1c0c54be7b.tar.gz volse-hubzilla-a0f6f8ad533ee0ef89cee104d0d0ef1c0c54be7b.tar.bz2 volse-hubzilla-a0f6f8ad533ee0ef89cee104d0d0ef1c0c54be7b.zip |
preserve utf-8 on notification emails
Diffstat (limited to 'mod/dfrn_notify.php')
-rw-r--r-- | mod/dfrn_notify.php | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/mod/dfrn_notify.php b/mod/dfrn_notify.php index fc609ddc0..630af8398 100644 --- a/mod/dfrn_notify.php +++ b/mod/dfrn_notify.php @@ -111,8 +111,18 @@ function dfrn_notify_post(&$a) { // send email notification if requested. + $body = html_entity + require_once('bbcode.php'); if($importer['notify-flags'] & NOTIFY_MAIL) { + + $body = html_entity_decode(strip_tags(bbcode(stripslashes($msg['body']))),ENT_QUOTES,'UTF-8'); + + if(function_exists('quoted_printable_encode')) + $body = quoted_printable_encode($body); + else + $body = qp($body); + $tpl = load_view_file('view/mail_received_eml.tpl'); $email_tpl = replace_macros($tpl, array( '$sitename' => $a->config['sitename'], @@ -121,11 +131,15 @@ function dfrn_notify_post(&$a) { '$email' => $importer['email'], '$from' => $msg['from-name'], '$title' => stripslashes($msg['title']), - '$body' => strip_tags(bbcode(stripslashes($msg['body']))) + '$body' => $body )); $res = mail($importer['email'], t('New mail received at ') . $a->config['sitename'], - $email_tpl, 'From: ' . t('Administrator') . '@' . $a->get_hostname() ); + $email_tpl, 'From: ' . t('Administrator') . '@' . $a->get_hostname() . "\r\n" + . 'MIME-Version: 1.0' . "\r\n" + . 'Content-type: text/plain; charset=UTF-8' . "\r\n" + . 'Content-transfer-encoding: quoted-printable' . "\r\n" + ); } xml_status(0); // NOTREACHED |