Closed (fixed)
Project:
Premium
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jun 2006 at 22:41 UTC
Updated:
4 Sep 2007 at 17:41 UTC
Certainly running on mySQL 4.1 and 5.0 there is a bug due to the mixing of data types in the SQL in the premium_cron function. The times are stored as unix timestamps but the code uses the NOW() function which returns a date/time value.
<?php
function premium_cron() {
db_query('DELETE FROM {premium} WHERE start_ts < NOW() AND end_ts != 0 AND end_ts < NOW()');
}
?>should be replaced by
<?php
function premium_cron() {
db_query('DELETE FROM {premium} WHERE start_ts < UNIX_TIMESTAMP() AND end_ts != 0 AND end_ts < UNIX_TIMESTAMP()');
}
?>Simon
Comments
Comment #1
buddaSo this would also be a problem in the premium_nodeapi() function:
Comment #2
allie mickaCommitted both fixes. Thanks!
Comment #3
(not verified) commented