r86358 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86357‎ | r86358 | r86359 >
Date:22:42, 18 April 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
fixed obvious devision by zero issue
Modified paths:
  • /trunk/extensions/Ratings/Ratings.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Ratings/Ratings.class.php
@@ -131,7 +131,7 @@
132132 }
133133
134134 foreach ( $tags as &$tag ) {
135 - $tag['avarage'] = $tag['total'] / $tag['count'];
 135+ $tag['avarage'] = $tag['count'] > 0 ? $tag['total'] / $tag['count'] : 0;
136136 }
137137
138138 return $tags;

Status & tagging log