mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
67743359a1
commit
49fa87cceb
@ -395,15 +395,16 @@ function htmlEmail($to, $from, $subject, $htmlContent, $attachedFiles = false, $
|
|||||||
$plainEncoding = "";
|
$plainEncoding = "";
|
||||||
|
|
||||||
// We generate plaintext content by default, but you can pass custom stuff
|
// We generate plaintext content by default, but you can pass custom stuff
|
||||||
|
$plainEncoding = '';
|
||||||
if(!$plainContent) {
|
if(!$plainContent) {
|
||||||
$plainContent = Convert::xml2raw($htmlContent);
|
$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
|
// If the subject line contains extended characters, we must encode the
|
||||||
$subject = Convert::xml2raw($subject);
|
$subject = Convert::xml2raw($subject);
|
||||||
if($subjectIsUnicode)
|
if(isset($subjectIsUnicode) && $subjectIsUnicode)
|
||||||
$subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
|
$subject = "=?UTF-8?B?" . base64_encode($subject) . "?=";
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user