From d335bb22a2340f3018bf6ef8fc6acf4832845c59 Mon Sep 17 00:00:00 2001 From: BENKE Charlene <1179011+defrance@users.noreply.github.com> Date: Thu, 9 Jun 2022 15:13:29 +0200 Subject: [PATCH] Update html.formmail.class.php --- htdocs/core/class/html.formmail.class.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index ad6a6c12508..c99bad2bf72 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -395,7 +395,7 @@ class FormMail extends Form // Define output language $outputlangs = $langs; $newlang = ''; - if ($conf->global->MAIN_MULTILANGS && empty($newlang)) { + if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) { $newlang = $this->param['langsmodels']; } if (!empty($newlang)) { @@ -584,7 +584,10 @@ class FormMail extends Form } // Add also company main email - $liste['company'] = $conf->global->MAIN_INFO_SOCIETE_NOM.' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; + if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL)) { + $liste['company'] = !empty($conf->global->MAIN_INFO_SOCIETE_NOM)?$conf->global->MAIN_INFO_SOCIETE_NOM:$conf->global->MAIN_INFO_SOCIETE_MAIL; + $liste['company'].=' <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; + } // Add also email aliases if there is some $listaliases = array( @@ -1540,7 +1543,7 @@ class FormMail extends Form $extrafields->fetch_name_optionals_label($product->table_element, true); - if (is_array($extrafields->attributes[$product->table_element]['label']) && count($extrafields->attributes[$product->table_element]['label']) > 0) { + if (!empty($extrafields->attributes[$product->table_element]['label']) && is_array($extrafields->attributes[$product->table_element]['label']) && count($extrafields->attributes[$product->table_element]['label']) > 0) { foreach ($extrafields->attributes[$product->table_element]['label'] as $key => $label) { $substit_line['__PRODUCT_EXTRAFIELD_'.strtoupper($key).'__'] = $product->array_options['options_'.$key]; }