From 49fa87ccebadd969c2272beb2ba08c1e1e132c88 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 15 Sep 2007 21:05:58 +0000 Subject: [PATCH] elofgren: VAR FIX: Prevent errors when sending newsletter drafts by initializing variables and calling isset() and empty() where needed in core/Email.php (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@41938 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Email.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/Email.php b/core/Email.php index dc03810ca..c1248de36 100755 --- a/core/Email.php +++ b/core/Email.php @@ -395,15 +395,16 @@ function htmlEmail($to, $from, $subject, $htmlContent, $attachedFiles = false, $ $plainEncoding = ""; // We generate plaintext content by default, but you can pass custom stuff + $plainEncoding = ''; if(!$plainContent) { $plainContent = Convert::xml2raw($htmlContent); - if($bodyIsUnicode) $plainEncoding = "base64"; + if(isset($bodyIsUnicode) && $bodyIsUnicode) $plainEncoding = "base64"; } // If the subject line contains extended characters, we must encode the $subject = Convert::xml2raw($subject); - if($subjectIsUnicode) + if(isset($subjectIsUnicode) && $subjectIsUnicode) $subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";