Fix php compatibility

This commit is contained in:
Laurent Destailleur 2021-11-28 15:43:22 +01:00
parent ca11dcae22
commit c41578a3c3
3 changed files with 3 additions and 3 deletions

View File

@ -186,7 +186,7 @@ foreach ($fulltree as $key => $val) {
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
: $categstatic->getObjectsInCateg($type, 1);
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : '0')."</td>";
$counter = "<td class='left' width='40px;'>".(is_array($elements) ? count($elements) : '0')."</td>";
}
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';

View File

@ -378,7 +378,7 @@ if ($cats < 0) {
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
: $categstatic->getObjectsInCateg($type, 1);
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : '0')."</td>";
$counter = "<td class='left' width='40px;'>".(is_array($elements) ? count($elements) : '0')."</td>";
}
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';

View File

@ -860,7 +860,7 @@ abstract class CommonObject
if (!empty($conf->socialnetworks->enabled)) {
$outsocialnetwork = '';
if (!empty($this->socialnetworks) && is_countable($this->socialnetworks) && count($this->socialnetworks) > 0) {
if (!empty($this->socialnetworks) && is_array($this->socialnetworks) && count($this->socialnetworks) > 0) {
$socialnetworksdict = getArrayOfSocialNetworks();
foreach ($this->socialnetworks as $key => $value) {
if ($value) {