[spam-stopper] Re: A Potential Delete Problem caused by UI and time lag - patch.

rich boakes rich at boakes.org
Wed Oct 26 17:53:10 UTC 2005

Hi All,

If anyone feels this is a big enough issue, then
I believe the enclosed patch for 1.0.3 fixes it.

I've tested it by adding some dummy entries to
the DB and setting some to have dates in the
future.  Only messages whose date is before the
time when the page is served get deleted.

Whilst this takes care of the possibility of
un-reviewed spam getting deleted, it may be
necessary to change the wording so that the
slightly altered behaviour makes sense to the user.


< 		$nuked = $wpdb->query("DELETE FROM
$wpdb->comments WHERE comment_approved = 'spam'");
> 		$displayed_gmt = $_POST['displayed_gmt'];
> 		$nuked = $wpdb->query("DELETE FROM
$wpdb->comments WHERE '$displayed_gmt' >
comment_date_gmt AND comment_approved = 'spam'");
> <input type="hidden" name="displayed_gmt"
value="<?php echo current_time('mysql', 1); ?>" />

More information about the spam-stopper mailing list