From 537a51b3676b30f1c5dbf3e908f440ec14ded484 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Jul 2016 11:19:16 +0200 Subject: [PATCH] Finally, better without the test --- htdocs/societe/class/societe.class.php | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 9f48f7c0541..3282d8a9eba 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1939,21 +1939,8 @@ class Societe extends CommonObject $contact_emails = $this->contact_property_array('email',1); if ($this->email && $addthirdparty) { - $exist = 0; - foreach($contact_emails as $contacts){ - if($exist ===0){ - $contacts = str_replace('>','',$contacts); - $contacts = explode ('<',$contacts); - if($contacts[1]===$this->email){ - $exist = 1; - } - } - } - if($exist ===0){ - if (empty($this->name)) $this->name=$this->nom; - $contact_emails['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->email.">"; - } - + if (empty($this->name)) $this->name=$this->nom; + $contact_emails['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->email.">"; } return $contact_emails; }