diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index c860a19d588..dec7584b68e 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -670,11 +670,10 @@ class Adherent extends CommonObject $this->town = ($this->town ? $this->town : $this->town); $this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id); $this->state_id = ($this->state_id > 0 ? $this->state_id : $this->state_id); - $this->setUpperOrLowerCase(); $this->note_public = ($this->note_public ? $this->note_public : $this->note_public); $this->note_private = ($this->note_private ? $this->note_private : $this->note_private); $this->url = $this->url ?clean_url($this->url, 0) : ''; - + $this->setUpperOrLowerCase(); // Check parameters if (!empty($conf->global->ADHERENT_MAIL_REQUIRED) && !isValidEMail($this->email)) { $langs->load("errors"); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 9fa3602ee4b..799b53cdad0 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -571,7 +571,6 @@ class Contact extends CommonObject $this->fax = trim($this->fax); $this->zip = (empty($this->zip) ? '' : trim($this->zip)); $this->town = (empty($this->town) ? '' : trim($this->town)); - $this->setUpperOrLowerCase(); $this->country_id = ($this->country_id > 0 ? $this->country_id : $this->country_id); if (empty($this->statut)) { $this->statut = 0; @@ -579,6 +578,7 @@ class Contact extends CommonObject if (empty($this->civility_code) && !is_numeric($this->civility_id)) { $this->civility_code = $this->civility_id; // For backward compatibility } + $this->setUpperOrLowerCase(); $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET"; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 01665e99ca5..f3c49ae1f75 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -759,6 +759,8 @@ abstract class CommonObject $this->address = dol_strtoupper($this->address); $this->town = dol_strtoupper($this->town); } + $this->email = dol_strtolower($this->email); + $this->personal_email = dol_strtolower($this->personal_email); } /** diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index a3f3c45806f..105178e3d65 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1271,7 +1271,6 @@ class Societe extends CommonObject $this->address = $this->address ?trim($this->address) : trim($this->address); $this->zip = $this->zip ?trim($this->zip) : trim($this->zip); $this->town = $this->town ?trim($this->town) : trim($this->town); - $this->setUpperOrLowerCase(); $this->state_id = trim($this->state_id); $this->country_id = ($this->country_id > 0) ? $this->country_id : 0; $this->phone = trim($this->phone); @@ -1280,7 +1279,7 @@ class Societe extends CommonObject $this->fax = trim($this->fax); $this->fax = preg_replace("/\s/", "", $this->fax); $this->fax = preg_replace("/\./", "", $this->fax); - $this->email = trim($this->email); + $this->email = trim($this->email); $this->url = $this->url ?clean_url($this->url, 0) : ''; $this->note_private = trim($this->note_private); $this->note_public = trim($this->note_public); @@ -1413,7 +1412,7 @@ class Societe extends CommonObject } } } - + $this->setUpperOrLowerCase(); if ($result >= 0) { dol_syslog(get_class($this)."::update verify ok or not done"); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index fcd1505a402..6fca728ee8b 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1864,7 +1864,6 @@ class User extends CommonObject $this->address = trim((string) $this->address); $this->zip = trim((string) $this->zip); $this->town = trim((string) $this->town); - $this->setUpperOrLowerCase(); $this->state_id = ($this->state_id > 0 ? $this->state_id : 0); $this->country_id = ($this->country_id > 0 ? $this->country_id : 0); @@ -1891,6 +1890,8 @@ class User extends CommonObject $this->birth = empty($this->birth) ? '' : $this->birth; $this->fk_warehouse = (int) $this->fk_warehouse; + $this->setUpperOrLowerCase(); + // Check parameters $badCharUnauthorizedIntoLoginName = getDolGlobalString('MAIN_LOGIN_BADCHARUNAUTHORIZED', ',@<>"\'');