Page MenuHomePhabricator

extensions/Editcount: Division / 0
Closed, ResolvedPublic

Description

  • SpecialEditcount.php Tue Dec 27 17:43:41 2005

+++ SpecialEditcount.php.new Tue Dec 27 12:38:48 2005
@@ -241,7 +245,7 @@

$total = wfMsgHtml( 'editcount_total' );
$ftotal = $wgLang->formatNum( $this->total );
  • $percent = wfPercent( $this->total / $this->total * 100 , 2 );

+ if ($total > 0 ) $percent = wfPercent( $this->total / $this-

total * 100 , 2 );

otherwise you get an division / 0 when total equals 0.


Version: unspecified
Severity: minor
URL: http://cvs.sourceforge.net/viewcvs.py/wikipedia/extensions/Editcount/

Details

Reference
bz4400

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:00 PM
bzimport set Reference to bz4400.
bzimport added a subscriber: Unknown Object (MLST).

avarab wrote:

Your patch had some logic errors as well, $total contains the string "Total" and
not the count (that's $this->total) and even if you fixed that you'd get
E_NOTICE errors when the count was equal to 0 because $percent, which is used
later, wouldn't have been defined in that case.

Anyway, I fixed the div by 0 error, thanks for the report;)

Marking this as FIXED in CVS HEAD