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
This commit is contained in:
Ingo Schommer 2007-09-15 21:05:58 +00:00
parent 67743359a1
commit 49fa87cceb
1 changed files with 3 additions and 2 deletions

View File

@ -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) . "?=";