Skip to content

Commit

Permalink
check if variable is an array before trying to count it
Browse files Browse the repository at this point in the history
  • Loading branch information
nkissebe committed Jan 26, 2025
1 parent 56c3dd4 commit 3c3c4c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/components/com_tags/helpers/activityLogPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function parse($log)
$decodedComments->entries = 0;
}

$entriesCount = count($decodedComments->entries);
$entriesCount = is_array($decodedComments) ? count($decodedComments->entries) : 0;
$objectId = isset($decodedComments->objectid) ? $decodedComments->objectid : 0;
$oldId = isset($decodedComments->old_id) ? $decodedComments->old_id : 0;
$rawTag = isset($decodedComments->raw_tag) ? $decodedComments->raw_tag : '';
Expand Down

0 comments on commit 3c3c4c4

Please sign in to comment.