New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Division by zero FPD #1956
Comments
Added the second part; |
Probably, if we want to be consistent at least. I'd also add a minimum note to that setting's description because some admins may think that 0 disables the maximum. As for the commits you made - I think the check should be rather something like: $perpage = (int)$mybb->settings['repsperpage'];
if($perpage < 1) to be completely safe. Because right now someone can change it to |
Integers can be negative, so that would have to go by Doing the thing with |
That wouldn't make any sense in any of the settings mentioned in this issue though - per page and warning points are supposed to be always positive.
I don't see the need of |
True, but it should be corrected anyway because it emits a PHP error, leading to FPD (you never know when it might get in handy for someone).
In this case there is no such check ( |
I'm still not sure what you mean, |
Right, |
All found issues originate from the maxwarningpoints setting being equal to zero and emit a PHP warning Division by zero.
https://github.com/mybb/mybb/blob/feature/admin/modules/user/users.php#L1056
https://github.com/mybb/mybb/blob/feature/admin/modules/user/users.php#L3570
https://github.com/mybb/mybb/blob/feature/inc/datahandlers/warnings.php#L373
https://github.com/mybb/mybb/blob/feature/inc/datahandlers/warnings.php#L374
https://github.com/mybb/mybb/blob/feature/inc/datahandlers/warnings.php#L561
https://github.com/mybb/mybb/blob/feature/inc/datahandlers/warnings.php#L562
https://github.com/mybb/mybb/blob/feature/inc/functions_post.php#L377
https://github.com/mybb/mybb/blob/feature/member.php#L2430
https://github.com/mybb/mybb/blob/feature/usercp.php#L3694
https://github.com/mybb/mybb/blob/feature/warnings.php#L344
https://github.com/mybb/mybb/blob/feature/warnings.php#L411
https://github.com/mybb/mybb/blob/feature/warnings.php#L741
repsperpage setting-related:
https://github.com/mybb/mybb/blob/feature/reputation.php#L835
https://github.com/mybb/mybb/blob/feature/reputation.php#L854 (zero as an argument)
membersperpage setting-related:
https://github.com/mybb/mybb/blob/feature/managegroup.php#L355 (zero as an argument)
Original thread: Division by zero FPD
The text was updated successfully, but these errors were encountered: