From b69031e979016765f2b13916a70a82a0a97181bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Sep 2022 03:23:03 +0200 Subject: [PATCH] Fix php8.1 --- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/contact/class/contact.class.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- htdocs/user/class/user.class.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 73c527cb2eb..ae26b84baa5 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1405,7 +1405,7 @@ class Adherent extends CommonObject $this->email = $obj->email; $this->url = $obj->url; - $this->socialnetworks = (array) json_decode($obj->socialnetworks, true); + $this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array()); $this->photo = $obj->photo; $this->statut = $obj->statut; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 0a38c1294d4..638022b855a 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1068,7 +1068,7 @@ class Contact extends CommonObject $this->phone_mobile = trim($obj->phone_mobile); $this->email = $obj->email; - $this->socialnetworks = (array) json_decode($obj->socialnetworks, true); + $this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array()); $this->photo = $obj->photo; $this->priv = $obj->priv; $this->mail = $obj->email; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 717278379e4..19f1c79565c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1844,7 +1844,7 @@ class Societe extends CommonObject $this->stcomm_picto = $obj->stcomm_picto; // picto statut commercial $this->email = $obj->email; - $this->socialnetworks = (array) json_decode($obj->socialnetworks, true); + $this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array()); $this->url = $obj->url; $this->phone = $obj->phone; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 126bebae64f..a0e6c16fe45 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -546,7 +546,7 @@ class User extends CommonObject $this->personal_mobile = $obj->personal_mobile; $this->email = $obj->email; $this->personal_email = $obj->personal_email; - $this->socialnetworks = (array) json_decode($obj->socialnetworks, true); + $this->socialnetworks = ($obj->socialnetworks ? (array) json_decode($obj->socialnetworks, true) : array()); $this->job = $obj->job; $this->signature = $obj->signature; $this->admin = $obj->admin;