Don't spew notices when building tag cloud if there is no popularity sum to divide by.
This commit is contained in:
parent
783a2e249b
commit
11d7365a15
|
@ -136,7 +136,12 @@ class PublictagcloudAction extends Action
|
|||
$this->elementStart('dd');
|
||||
$this->elementStart('ul', 'tags xoxo tag-cloud');
|
||||
foreach ($tw as $tag => $weight) {
|
||||
$this->showTag($tag, $weight, $weight/$sum);
|
||||
if ($sum) {
|
||||
$weightedSum = $weight/$sum;
|
||||
} else {
|
||||
$weightedSum = 1;
|
||||
}
|
||||
$this->showTag($tag, $weight, $weightedSum);
|
||||
}
|
||||
$this->elementEnd('ul');
|
||||
$this->elementEnd('dd');
|
||||
|
|
Loading…
Reference in New Issue
Block a user