Changeset 18370


Ignore:
Timestamp:
09/29/12 12:00:12 (7 years ago)
Author:
mistic100
Message:

avoid false positive ("ass" won't block "classroom")

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/comments_blacklist/include/functions.inc.php

    r18369 r18370  
    1313  $blacklist = file(COMM_BLACKLIST_FILE, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); 
    1414  $blacklist = array_map('strtolower', $blacklist); 
    15   $content = strtolower($comm['content']); 
    16   $author = strtolower($comm['author']); 
     15  $content = ' '.strtolower($comm['content']).' '; 
     16  $author = ' '.strtolower($comm['author']).' '; 
    1717   
    1818  foreach ($blacklist as $word) 
    1919  { 
     20    $word = ' '.$word.' '; 
    2021    if ( strpos($content, $word)!==false or strpos($author, $word)!==false ) 
    2122    { 
Note: See TracChangeset for help on using the changeset viewer.