diff --git a/libraries/cms/helper/tags.php b/libraries/cms/helper/tags.php index 327337e122759..e7291b33d51ce 100644 --- a/libraries/cms/helper/tags.php +++ b/libraries/cms/helper/tags.php @@ -532,14 +532,14 @@ public function getTagItemsQuery($tagId, $typesr = null, $includeChildren = fals $nullDate = $db->quote($db->getNullDate()); $nowDate = $db->quote(JFactory::getDate()->toSql()); - $ntagsr = substr_count($tagId, ',') + 1; - // Force ids to array and sanitize $tagIds = (array) $tagId; $tagIds = implode(',', $tagIds); $tagIds = explode(',', $tagIds); $tagIds = ArrayHelper::toInteger($tagIds); + $ntagsr = count($tagIds); + // If we want to include children we have to adjust the list of tags. // We do not search child tags when the match all option is selected. if ($includeChildren)