From acff378781a0ed6b5f564421b3919cc7884ee8fd Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Thu, 23 Aug 2007 23:50:53 +0000 Subject: [PATCH] Fixed some php notices git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@40776 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/Email.php | 11 ++++++++--- core/SSViewer.php | 2 +- core/model/DataObject.php | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) 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 "

Template: $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);