diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 9b9bb32865e..38987b36185 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -908,7 +908,6 @@ class FormMail extends Form
$defaultmessage=preg_replace("/^(
)+/","",$defaultmessage);
$defaultmessage=preg_replace("/^\n+/","",$defaultmessage);
}
-
$out.= '
';
$out.= '| '.$langs->trans("MailText").' | ';
$out.= '';
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 7a70608f303..05024437a63 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -5733,6 +5733,8 @@ function make_substitutions($text, $substitutionarray, $outputlangs=null)
// Make substitition for array $substitutionarray
foreach ($substitutionarray as $key => $value)
{
+ if (! isset($value)) continue; // If value is null, it same than not having substitution key at all into array, we do not replace.
+
if ($key == '__SIGNATURE__' && (! empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) $value=''; // Protection
if ($key == '__USER_SIGNATURE__' && (! empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) $value=''; // Protection
|