OUGC-Network / OUGC-Awards

Adds a powerful awards system to you community.
https://ougc.network
GNU General Public License v3.0
8 stars 7 forks source link

Division by zero is not allowed on profiles. #62

Open Sama34 opened 4 years ago

Sama34 commented 4 years ago

Describe the bug The plugin attempts to build the award list of users in profiles even if the user doesn't have any award.

To Reproduce Steps to reproduce the behavior:

  1. Visit the profile of a user with no awards.
  2. PHP warning sohuld be displayed.

Expected behavior If the user doesn't have awards then the multipage shouln't be built and one query sasved.

Screenshots If applicable, add screenshots to help explain your problem. image

Additional context https://community.mybb.com/thread-227052.html

h2kyaw commented 2 years ago

find

$multipage = (string)multipage($awardscount, $awards->query_limit_profile, $page, $awards->build_url('view=awards'));

Replace with:

$multipage = $multipage ? (string)multipage($awardscount, $awards->query_limit_profile, $page, $awards->build_url('view=awards')) : '' ;

You haven't update your repo yet. You answer at forum but don't see that changes in code repo xD.