Skip to content
Permalink
Browse files

Modern version :-)

  • Loading branch information...
moodler
moodler committed Mar 5, 2005
1 parent 3d3f159 commit dc15cff35a139a32183169181cc59094e134303a
Showing with 7 additions and 7 deletions.
  1. +7 −7 filter/censor/filter.php
@@ -14,17 +14,17 @@
function censor_filter($courseid, $text) {
static $search, $replace;
static $words;
if (empty($search)) {
$search = explode(',', get_string('censorbadwords'));
rsort($search);
foreach ($search as $key => $word) {
$replace[$key] = '<span class="censoredtext">'.$word.'</span>';
if (empty($words)) {
$words = array();
$badwords = explode(',', get_string('censorbadwords'));
foreach ($badwords as $badword) {
$words[] = new filterobject($badword, '<span class="censoredtext">', '</span>', false, false);
}
}
return str_ireplace($search, $replace, $text);
return filter_phrases($text, $words); // Look for all these words in the text
}

0 comments on commit dc15cff

Please sign in to comment.
You can’t perform that action at this time.