MyBB Community Forums

Full Version: [F] Time calculation bugs in promotions.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I found a few bugs from the time difference calculation in inc/tasks/promotions.php, which make the registration age requirement 7 times larger than it should be, when using months or years as a measure:

line 52 (months):
$regdate = $promotion['registered']*60*60*24*7*30;
should be:
$regdate = $promotion['registered']*60*60*24*30;

line 55 (years):
$regdate = $promotion['registered']*60*60*24*7*365;
should be:
$regdate = $promotion['registered']*60*60*24*365;

The header says:
* $Id: promotions.php 3883 2008-06-05 00:38:28Z Tikitiki $
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.