Merge pull request #10594 from frederic34/patch-31

Update website.class.php
This commit is contained in:
Laurent Destailleur 2019-02-14 13:32:22 +01:00 committed by GitHub
commit ce83db0585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,7 +123,7 @@ class Website extends CommonObject
// Clean parameters // Clean parameters
if (isset($this->entity)) { if (isset($this->entity)) {
$this->entity = trim($this->entity); $this->entity = (int) $this->entity;
} }
if (isset($this->ref)) { if (isset($this->ref)) {
$this->ref = trim($this->ref); $this->ref = trim($this->ref);
@ -132,7 +132,7 @@ class Website extends CommonObject
$this->description = trim($this->description); $this->description = trim($this->description);
} }
if (isset($this->status)) { if (isset($this->status)) {
$this->status = trim($this->status); $this->status = (int) $this->status;
} }
if (empty($this->date_creation)) { if (empty($this->date_creation)) {
$this->date_creation = $now; $this->date_creation = $now;
@ -388,7 +388,7 @@ class Website extends CommonObject
// Clean parameters // Clean parameters
if (isset($this->entity)) { if (isset($this->entity)) {
$this->entity = trim($this->entity); $this->entity = (int) $this->entity;
} }
if (isset($this->ref)) { if (isset($this->ref)) {
$this->ref = trim($this->ref); $this->ref = trim($this->ref);
@ -397,7 +397,7 @@ class Website extends CommonObject
$this->description = trim($this->description); $this->description = trim($this->description);
} }
if (isset($this->status)) { if (isset($this->status)) {
$this->status = trim($this->status); $this->status = (int) $this->status;
} }
// Check parameters // Check parameters
@ -519,7 +519,7 @@ class Website extends CommonObject
*/ */
public function createFromClone($user, $fromid, $newref, $newlang = '') public function createFromClone($user, $fromid, $newref, $newlang = '')
{ {
global $hookmanager, $langs; global $conf, $hookmanager, $langs;
global $dolibarr_main_data_root; global $dolibarr_main_data_root;
$now = dol_now(); $now = dol_now();