Changeset 26112
- Timestamp:
- Dec 23, 2013, 11:45:56 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/comments_blacklist/include/functions.inc.php
r18651 r26112 6 6 global $conf; 7 7 8 if ( $comment_action==$conf['comments_blacklist']['action'] or $comment_action=='reject')8 if ($comment_action==$conf['comments_blacklist']['action'] or $comment_action=='reject') 9 9 { 10 10 return $comment_action; … … 18 18 } 19 19 20 $blacklist = array_map(create_function('$w', 'return " ".preg_quote($w)." ";'), $blacklist);20 $blacklist = array_map(create_function('$w', 'return preg_quote($w);'), $blacklist); 21 21 $blacklist = implode('|', $blacklist); 22 23 $content = str_replace(array("\r\n","\n"), ' ', $comm['content']);24 22 25 if ( preg_match('#('.$blacklist.')#i', ' '.$comm['author'].' ') or preg_match('#('.$blacklist.')#i', ' '.$content.' ') ) 23 if (preg_match('#\b('.$blacklist.')\b#i', $comm['author']) or 24 preg_match('#\b('.$blacklist.')\b#i', $comm['content']) 25 ) 26 26 { 27 27 return $conf['comments_blacklist']['action'];
Note: See TracChangeset
for help on using the changeset viewer.