Changeset 2155 for trunk


Ignore:
Timestamp:
Oct 30, 2007, 12:39:41 AM (17 years ago)
Author:
rvelices
Message:
  • send status code 403 when attempt to enter a user comment, but comments are disabled
  • don't increase hit count when a comment is posted
  • remove the check of user ip agains spamhaus.org when a comment is entered (my conclusion is that is useless)
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/config_default.inc.php

    r2106 r2155  
    9494// maximum number of links in a comment before it is qualified spam
    9595$conf['comment_spam_max_links'] = 3;
    96 
    97 // if the ip address of a comenteer is in spamhaus.org block list, the
    98 // comment is qualified spam
    99 $conf['comment_spam_check_ip'] = false;
    10096
    10197// calendar_datefield : date field of table "images" used for calendar
  • trunk/include/functions_comment.inc.php

    r2029 r2155  
    3131{
    3232  global $conf;
    33  
     33
    3434  $time = time();
    3535
     
    6969    $link_count++;
    7070  }
    71  
     71
    7272  if ( $link_count>$conf['comment_spam_max_links'] )
    7373    return $my_action;
    74 
    75   if ( isset($comment['ip']) and $conf['comment_spam_check_ip']
    76       and $_SERVER["SERVER_ADDR"] != $comment['ip'] 
    77     )
    78   {
    79     $rev_ip = implode( '.', array_reverse( explode('.',$comment['ip']) ) );
    80     $lookup = $rev_ip . '.sbl-xbl.spamhaus.org.';
    81     $res = gethostbyname( $lookup );
    82     if ( $lookup != $res )
    83       return $my_action;
    84   }
    8574
    8675  return $action;
     
    10190{
    10291  global $conf, $user;
    103  
    104   $comm = array_merge( $comm, 
     92
     93  $comm = array_merge( $comm,
    10594    array(
    10695      'ip' => $_SERVER['REMOTE_ADDR'],
     
    162151    $comment_action='reject';
    163152  }
    164  
     153
    165154  if ($comment_action!='reject' and $conf['anti-flood_time']>0 )
    166155  { // anti-flood system
     
    193182    "'.($comment_action=='validate' ? 'true':'false').'",
    194183    '.($comment_action=='validate' ? 'NOW()':'NULL').',
    195     '.$comm['image_id'].'     
     184    '.$comm['image_id'].'
    196185  )
    197186';
  • trunk/include/functions_url.inc.php

    r2083 r2155  
    253253  if ( !isset($params['category'] ) )
    254254  {// make urls shorter ...
    255     unset( $params['flat'] ); 
     255    unset( $params['flat'] );
    256256  }
    257257  $url .= make_section_in_url($params);
     
    623623 * parses start, flat and chronology from url tokens
    624624*/
    625 function parse_well_known_params_url($tokens, $i)
     625function parse_well_known_params_url($tokens, &$i)
    626626{
    627627  $page = array();
  • trunk/include/picture_comment.inc.php

    r2101 r2155  
    8888    );
    8989}
    90 
     90elseif ( isset($_POST['content']) )
     91{
     92  set_status_header(403);
     93  die('ugly spammer');
     94}
    9195
    9296if ($page['show_comments'])
  • trunk/picture.php

    r2079 r2155  
    245245
    246246// incrementation of the number of hits, we do this only if no action
    247 if (trigger_event('allow_increment_element_hit_count', true) )
     247if (trigger_event('allow_increment_element_hit_count', !isset($_POST['content']) ) )
    248248{
    249249  $query = '
Note: See TracChangeset for help on using the changeset viewer.