Fix substitutions null

This commit is contained in:
John Botella 2019-06-20 12:00:44 +02:00
parent 6a68c8cd99
commit b21006614c
2 changed files with 2 additions and 1 deletions

View File

@ -908,7 +908,6 @@ class FormMail extends Form
$defaultmessage=preg_replace("/^(<br>)+/","",$defaultmessage);
$defaultmessage=preg_replace("/^\n+/","",$defaultmessage);
}
$out.= '<tr>';
$out.= '<td valign="top">'.$langs->trans("MailText").'</td>';
$out.= '<td>';

View File

@ -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