https://bugzilla.wikimedia.org/show_bug.cgi?id=63980

            Bug ID: 63980
           Summary: Comparison of limits in pingLimiter is incorrect
           Product: MediaWiki
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Keywords: easy
          Severity: normal
          Priority: Unprioritized
         Component: General/Unknown
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: he7...@gmail.com
       Web browser: ---
   Mobile Platform: ---

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to