plugin freetag, related tags bug (<)
Posted: Sat Jun 25, 2011 7:42 pm
This (array) inside foreach disables non-array warnings and produces a fatal '<' => 0 tags content.
replace function with added if(is_array($rows)):
Code: Select all
1309 foreach((array)$rows as $r) {Code: Select all
#
# descend: if true, get the related tags of the related tags of given tag
#
function getTagCloudTags($tag, $descend = true) {
$rows = serendipity_db_query($this->getTagCloudQuery('', $tag));
if(is_array($rows)) {
foreach($rows as $r) {
$tags[$r['tag']] = $r['total'];
#get also tags which are related only by other tags
if($descend) {
$descended_tags = $this->getTagCloudTags($r['tag'], false);
foreach($descended_tags AS $dtag => $value) {
$descended_tags[$dtag] = $value / 2;
}
$tags = array_merge($tags, $descended_tags);
}
}
}
unset($tags["$tag"]);
return $tags;
}