From 7bb23086b86a5d8ac1527c073f0fab0a4f30dacd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 1 May 2014 17:06:14 +0200 Subject: [PATCH] Fix: Strict mode --- htdocs/core/class/CMailFile.class.php | 5 +++-- htdocs/core/lib/functions.lib.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 18b9cfb9b4f..7cf25b9992a 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -212,9 +212,10 @@ class CMailFile $text_body = $this->write_body($msg); // Encode images + $images_encoded = ''; if ($this->atleastoneimage) { - $images_encoded = $this->write_images($this->images_encoded); + $images_encoded.= $this->write_images($this->images_encoded); // always end related and end alternative after inline images $images_encoded.= "--" . $this->related_boundary . "--" . $this->eol; $images_encoded.= $this->eol . "--" . $this->alternative_boundary . "--" . $this->eol; @@ -742,7 +743,7 @@ class CMailFile } else { - $strContent.= $msgtext; + $strContent = $msgtext; } // Make RFC821 Compliant, replace bare linefeeds diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index fd562fc8d15..be6fc4d1e62 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -224,7 +224,8 @@ function GETPOST($paramname,$check='',$method=0) */ function dol_getprefix() { - return dol_hash($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT); + if (isset($_SERVER["SERVER_NAME"]) && isset($_SERVER["DOCUMENT_ROOT"])) return dol_hash($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT); + else return dol_hash(DOL_DOCUMENT_ROOT.DOL_URL_ROOT); } /**