Changeset 18651


Ignore:
Timestamp:
Oct 16, 2012, 10:53:09 AM (12 years ago)
Author:
mistic100
Message:

handle empty file case, check COA and GuestBook

Location:
extensions/comments_blacklist
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/comments_blacklist/admin.php

    r18369 r18651  
    1919$template->assign($conf['comments_blacklist']);
    2020$template->assign(array(
    21   'blacklist' => file_get_contents(COMM_BLACKLIST_FILE),
     21  'blacklist' => @file_get_contents(COMM_BLACKLIST_FILE),
    2222  'COMM_BLACKLIST_PATH'=> get_root_url() . COMM_BLACKLIST_PATH,
    2323  'COMM_BLACKLIST_ADMIN' => COMM_BLACKLIST_ADMIN,
  • extensions/comments_blacklist/include/functions.inc.php

    r18394 r18651  
    1111  }
    1212 
    13   $blacklist = file(COMM_BLACKLIST_FILE, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
     13  $blacklist = @file(COMM_BLACKLIST_FILE, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
     14 
     15  if (empty($blacklist))
     16  {
     17    return $comment_action;
     18  }
     19 
    1420  $blacklist = array_map(create_function('$w', 'return " ".preg_quote($w)." ";'), $blacklist);
    1521  $blacklist = implode('|', $blacklist);
  • extensions/comments_blacklist/main.inc.php

    r18369 r18651  
    3636{
    3737  add_event_handler('user_comment_check', 'comm_blacklist_user_comment_check', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
     38  add_event_handler('user_comment_check_albums', 'comm_blacklist_user_comment_check', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
     39  add_event_handler('user_comment_check_guestbook', 'comm_blacklist_user_comment_check', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
    3840  include_once(COMM_BLACKLIST_PATH . 'include/functions.inc.php');
    3941}
     
    4951  // apply upgrade if needed
    5052  if (
     53    COMM_BLACKLIST_VERSION == 'auto' or
    5154    $pwg_loaded_plugins[COMM_BLACKLIST_ID]['version'] == 'auto' or
    5255    version_compare($pwg_loaded_plugins[COMM_BLACKLIST_ID]['version'], COMM_BLACKLIST_VERSION, '<')
     
    5659    comm_blacklist_install();
    5760   
    58     if ($pwg_loaded_plugins[COMM_BLACKLIST_ID]['version'] != 'auto')
     61    if ( $pwg_loaded_plugins[COMM_BLACKLIST_ID]['version'] != 'auto' and COMM_BLACKLIST_VERSION != 'auto' )
    5962    {
    6063      $query = '
Note: See TracChangeset for help on using the changeset viewer.