From: Tim Starling Date: Sat, 3 Jan 2009 00:19:33 +0000 (+0000) Subject: Avoid division by zero X-Git-Tag: 1.31.0-rc.0~43595 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=3b2ed240d0ab9d1097be5432ccc878d842f262ef;p=lhc%2Fweb%2Fwiklou.git Avoid division by zero --- diff --git a/maintenance/storage/orphanStats.php b/maintenance/storage/orphanStats.php index 77bf465d08..afea815e78 100644 --- a/maintenance/storage/orphanStats.php +++ b/maintenance/storage/orphanStats.php @@ -36,9 +36,11 @@ class OrphanStats { } unset( $res ); - echo "Number of orphans: $num\n" . - "Average size: " . round( $totalSize / $num, 0 ) . " bytes\n" . + echo "Number of orphans: $num\n"; + if ( $num > 0 ) { + echo "Average size: " . round( $totalSize / $num, 0 ) . " bytes\n" . "Max size: $maxSize\n" . "Number of unique texts: " . count( $hashes ) . "\n"; + } } }