Added original word as title to the blacked-out version. This is because
the filter can obscure actual important words by mistake (eg Dickens) and there needs to be some way to recover the meaning.
This commit is contained in:
@@ -20,7 +20,9 @@ function censor_filter($courseid, $text) {
|
||||
$words = array();
|
||||
$badwords = explode(',', get_string('badwords', 'censor'));
|
||||
foreach ($badwords as $badword) {
|
||||
$words[] = new filterobject(trim($badword), '<span class="censoredtext">', '</span>', false, false,str_pad('',strlen(trim($badword)),'*'));
|
||||
$badword = trim($badword);
|
||||
$words[] = new filterobject($badword, '<span class="censoredtext" title="'.$badword.'">', '</span>',
|
||||
false, false, str_pad('',strlen($badword),'*'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user