Last modified: 2014-10-04 21:07:29 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 T65980, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 63980 - Comparison of limits in pingLimiter is incorrect
Comparison of limits in pingLimiter is incorrect
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.23.0
All All
: Low normal (vote)
: ---
Assigned To: Rohan Rawat
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-15 23:59 UTC by Helder
Modified: 2014-10-04 21:07 UTC (History)
2 users (show)

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


Attachments

Description Helder 2014-04-15 23:59:10 UTC
There is a comment on includes/User.php saying that
> If more than one group applies, use the group with the highest limit
However, if I understood the code correctly, the comparison of the limits is not correct. For example, consider these two limits:
> $limit1 = array( 1, 10 );
> $limit2 = array( 2, 60 );
The highest limit is $limit1, which allows 6 actions per minute, but a test like
$limit1 > $limit2 will be false (it is a comparison of the first entries of the arrays, right?):
http://3v4l.org/vhf4Q

It should probably compare quotients like "actions/seconds" to decide which limit is the highest.


[1] https://github.com/wikimedia/mediawiki-core/blob/820984dd20a6c7a84e8229fa6b66608a41f6121d/includes/User.php#L1680-L1683
Comment 1 Gerrit Notification Bot 2014-06-10 14:53:26 UTC
Change 138609 had a related patch set uploaded by Rohan013:
Fix for Bug 63980 - Comparison of limits in pingLimiter is incorrect

https://gerrit.wikimedia.org/r/138609
Comment 2 Gerrit Notification Bot 2014-10-04 20:35:36 UTC
Change 138609 merged by jenkins-bot:
Fix for Bug 63980 - Comparison of limits in pingLimiter is incorrect

https://gerrit.wikimedia.org/r/138609

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


Navigation
Links