diff --git a/core/Email.php b/core/Email.php
index 4a91fa5cb..5513c3603 100755
--- a/core/Email.php
+++ b/core/Email.php
@@ -508,7 +508,9 @@ function htmlEmail($to, $from, $subject, $htmlContent, $attachedFiles = false, $
* Send a plain text e-mail
*/
function plaintextEmail($to, $from, $subject, $plainContent, $attachedFiles, $customheaders = false) {
-
+ $subjectIsUnicode = false;
+ $plainEncoding = false; // Not ensurely where this is supposed to be set, but defined it false for now to remove php notices
+
if ($customheaders && is_array($customheaders) == false) {
echo "htmlEmail($to, $from, $subject, ...) could not send mail: improper \$customheaders passed:
";
dieprintr($headers);
@@ -556,7 +558,7 @@ function plaintextEmail($to, $from, $subject, $plainContent, $attachedFiles, $cu
$headers["From"] = validEmailAddr($from);
// Messages with the X-SilverStripeMessageID header can be tracked
- if($customheaders["X-SilverStripeMessageID"]) {
+ if(isset($customheaders["X-SilverStripeMessageID"])) {
$bounceAddress = BOUNCE_EMAIL;
// Get the human name from the from address, if there is one
if(ereg('^([^<>]+)<([^<>])> *$', $from, $parts))
@@ -567,7 +569,9 @@ function plaintextEmail($to, $from, $subject, $plainContent, $attachedFiles, $cu
// $headers["Sender"] = $from;
$headers["X-Mailer"] = X_MAILER;
- if (! $customheaders["X-Priority"]) $headers["X-Priority"] = 3;
+ if(!isset($customheaders["X-Priority"])) {
+ $headers["X-Priority"] = 3;
+ }
$headers = array_merge((array)$headers, (array)$customheaders);
@@ -656,6 +660,7 @@ function wrapImagesInline_rewriter($url) {
* Combine headers w/ the body into a single string
*/
function processHeaders($headers, $body = false) {
+ $res = '';
if(is_array($headers)) while(list($k, $v) = each($headers))
$res .= "$k: $v\n";
if($body) $res .= "\n$body";
diff --git a/core/SSViewer.php b/core/SSViewer.php
index bb6d8e602..854d78f2c 100644
--- a/core/SSViewer.php
+++ b/core/SSViewer.php
@@ -335,7 +335,7 @@ class SSViewer_FromString extends SSViewer {
fwrite($fh, $template);
fclose($fh);
- if($_GET['showtemplate']) {
+ if(isset($_GET['showtemplate'])) {
$lines = file($tmpFile);
echo "
"; diff --git a/core/model/DataObject.php b/core/model/DataObject.php index 65b28beea..417e5a008 100644 --- a/core/model/DataObject.php +++ b/core/model/DataObject.php @@ -468,7 +468,7 @@ class DataObject extends Controller { $this->extend('augmentWrite', $manipulation); // New records have their insert into the base data table done first, so that they can pass the // generated ID on to the rest of the manipulation - if(isset($isNewRecord) && $isNewRecord && $manipulation[$baseTable]) { + if(isset($isNewRecord) && $isNewRecord && isset($manipulation[$baseTable])) { $manipulation[$baseTable]['command'] = 'update'; } DB::manipulate($manipulation);