#2982 - Bug in gift points used calculations

  • By
  • Added
  • 3 views
Identifier #2982
Issue type Minor issue (breaks specific functionality)
Title Bug in gift points used calculations
Status Closed (no changes needed)
Handling member Chris Graham
Addon points
Description In line 208 of points.php within the get_gift_points_used function:

return ($claimed_used < 0) ? $claimed_used : $actual_used; // Still allows $claimed_used to be fiddled to negative give members extra gift points

The problem with this line is that if I had set a negative amount of gift points used, then the calculations completely ignore everything in the 'gifts' database table and instead base off of solely the value of that CPF.

For example, a user has used 1,070 gift points according to the gifts database calculations. Their "gift points used" field is 0. I set the field to "-1000" to attempt to reward them 1,000 gift points. But because of the calculations neglecting the gifts table in this instance, technically the member is being awarded back all gift points they used in addition to 1,000 more gift points because of the "-1000" setting. In other words, they really earned (1,070 + 1,000 =) 2,070 gift points instead of 1,000 from that edit.
Steps to reproduce

Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated