diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php
index 708fb3a3e83..c585217dfda 100644
--- a/htdocs/categories/index.php
+++ b/htdocs/categories/index.php
@@ -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 = "
".(is_countable($elements) ? count($elements) : '0')." | ";
+ $counter = "".(is_array($elements) ? count($elements) : '0')." | ";
}
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index eeca990ef28..a1f63b997e8 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -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 = "".(is_countable($elements) ? count($elements) : '0')." | ";
+ $counter = "".(is_array($elements) ? count($elements) : '0')." | ";
}
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index e8a8eb2843e..85987c8a3cf 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -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) {