Update contact.class.php

This commit is contained in:
Anthony Berton 2019-12-12 17:20:20 +01:00 committed by GitHub
parent 380b698c6f
commit 21a28e4bb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -261,6 +261,7 @@ class Contact extends CommonObject
$this->lastname = $this->lastname ?trim($this->lastname) : trim($this->name);
$this->firstname = trim($this->firstname);
if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname);
if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname);
if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname);
if (empty($this->socid)) $this->socid = 0;
if (empty($this->priv)) $this->priv = 0;
@ -372,6 +373,10 @@ class Contact extends CommonObject
$this->entity = ((isset($this->entity) && is_numeric($this->entity)) ? $this->entity : $conf->entity);
// Clean parameters
if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->lastname = ucwords($this->lastname);
if (!empty($conf->global->MAIN_ALL_TO_UPPER)) $this->lastname = strtoupper($this->lastname);
if (!empty($conf->global->MAIN_FIRST_TO_UPPER)) $this->firstname = ucwords($this->firstname);
$this->lastname = trim($this->lastname) ?trim($this->lastname) : trim($this->lastname);
$this->firstname = trim($this->firstname);
$this->email = trim($this->email);