Last modified: 2010-05-15 14:36:12 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T6400, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 4400 - extensions/Editcount: Division / 0
extensions/Editcount: Division / 0
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Editcount (Other open bugs)
unspecified
All All
: Normal minor with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
http://cvs.sourceforge.net/viewcvs.py...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-12-27 16:44 UTC by Florian Steinel
Modified: 2010-05-15 14:36 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Florian Steinel 2005-12-27 16:44:58 UTC
--- 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.
Comment 1 Ævar Arnfjörð Bjarmason 2005-12-27 16:55:49 UTC
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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links