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];
}