Ignore:
Timestamp:
Jun 25, 2010, 9:45:19 PM (14 years ago)
Author:
nikrou
Message:

Bug 1744 fixed : Incorrect use of timezone with SQLite
Fixed anti-flood system.

Merge from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.1/include/functions_comment.inc.php

    r6602 r6605  
    134134  if ($comment_action!='reject' and $conf['anti-flood_time']>0 )
    135135  { // anti-flood system
    136     $reference_date = date('c', time() - $conf['anti-flood_time']);
     136    $reference_date = pwg_db_get_flood_period_expression($conf['anti-flood_time']);
     137
    137138    $query = '
    138 SELECT id FROM '.COMMENTS_TABLE.'
    139   WHERE date > \''.$reference_date.'\'
     139SELECT count(1) FROM '.COMMENTS_TABLE.'
     140  WHERE date > '.$reference_date.'
    140141    AND author_id = '.$comm['author_id'];
    141     if ( pwg_db_num_rows( pwg_query( $query ) ) > 0 )
     142    list($counter) = pwg_db_fetch_row(pwg_query($query));
     143    if ( $counter > 0 )
    142144    {
    143145      array_push( $infos, l10n('Anti-flood system : please wait for a moment before trying to post another comment') );
Note: See TracChangeset for help on using the changeset viewer.