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

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 4400 - extensions/Editcount: Division / 0
extensions/Editcount: Division / 0
Product: MediaWiki extensions
Classification: Unclassified
Editcount (Other open bugs)
All All
: Normal minor with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  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: ---


Description Florian Steinel 2005-12-27 16:44:58 UTC
--- SpecialEditcount.php        Tue Dec 27 17:43:41 2005
+++    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.