From dc2db5982590eb36bcd15d648f15070471833545 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 11 Aug 2008 15:31:33 +0000 Subject: Downgraded UTF support in the email notification function to optional git-svn-id: https://code.elgg.org/elgg/trunk@1836 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/notification.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/notification.php b/engine/lib/notification.php index c483f1ed8..bdfbf65c3 100644 --- a/engine/lib/notification.php +++ b/engine/lib/notification.php @@ -237,15 +237,23 @@ } else*/ $from = 'noreply@' . get_site_domain($CONFIG->site_guid); // Handle a fallback - - mb_internal_encoding('UTF-8'); - $site = get_entity($CONFIG->site_guid); - $sitename = mb_encode_mimeheader($site->name,"UTF-8", "B"); + + if (is_callable('mb_internal_encoding')) { + mb_internal_encoding('UTF-8'); + } + $site = get_entity($CONFIG->site_guid); + $sitename = $site->name; + if (is_callable('mb_encode_mimeheader')) { + $sitename = mb_encode_mimeheader($site->name,"UTF-8", "B"); + } $headers = "From: $sitename <$from>\r\n" . "Content-Type: text/plain; charset=UTF-8; format=flowed\r\n" . "MIME-Version: 1.0\r\n" - . "Content-Transfer-Encoding: 8bit\r\n"; - $subject = mb_encode_mimeheader($subject,"UTF-8", "B"); + . "Content-Transfer-Encoding: 8bit\r\n"; + + if (is_callable('mb_encode_mimeheader')) { + $subject = mb_encode_mimeheader($subject,"UTF-8", "B"); + } return mail($to, $subject, wordwrap($message), $headers); } -- cgit v1.2.3