Index: trunk/extensions/FlaggedRevs/specialpages/RatingHistory_body.php |
— | — | @@ -262,6 +262,7 @@ |
263 | 263 | $totalVal = $totalCount = $n = 0; |
264 | 264 | // Define the data using the DB rows |
265 | 265 | list($res,$u,$maxC,$days) = $this->doQuery( $tag ); |
| 266 | + if( !$maxC ) return false; |
266 | 267 | // Label spacing |
267 | 268 | $int = intval( ceil($days/10) ); // 10 labels at most |
268 | 269 | while( $row = $res->fetchObject() ) { |
— | — | @@ -362,6 +363,7 @@ |
363 | 364 | $totalVal = $totalCount = $sd = $pts = $n = 0; |
364 | 365 | // Define the data using the DB rows |
365 | 366 | list($res,$u,$maxC,$days) = $this->doQuery( $tag ); |
| 367 | + if( !$maxC ) return false; |
366 | 368 | // Label spacing |
367 | 369 | $int = intval( ceil($days/10) ); // 10 labels at most |
368 | 370 | while( $row = $res->fetchObject() ) { |
— | — | @@ -495,7 +497,8 @@ |
496 | 498 | } |
497 | 499 | $upper = wfTimestamp( TS_UNIX, $upper ); |
498 | 500 | $days = intval( ($upper - $lower)/86400 ); |
499 | | - $ave = 1 + $total/$count; // Offset to [1,5] |
| 501 | + if( $count ) |
| 502 | + $ave = 1 + $total/$count; // Offset to [1,5] |
500 | 503 | $res->seek( 0 ); // reset query row |
501 | 504 | } |
502 | 505 | return array($res,$ave,$maxC,$days); |