Provide setup screen for the censor bad words list. Note that for decencies

sake, I have decided to start with a blank word list rather than use the
provided one which may shock the unwary!
This commit is contained in:
thepurpleblob
2005-07-26 13:05:13 +00:00
parent f649fc24a6
commit bf9760c4a8
+6 -1
View File
@@ -15,10 +15,15 @@
function censor_filter($courseid, $text) {
static $words;
global $CFG;
if (!isset($CFG->filter_censor_badwords)) {
set_config( 'filter_censor_badwords','' );
}
if (empty($words)) {
$words = array();
$badwords = explode(',', get_string('badwords', 'censor'));
$badwords = explode(',', $CFG->filter_censor_badwords );
foreach ($badwords as $badword) {
$words[] = new filterobject(trim($badword), '<span class="censoredtext">', '</span>', false, false,str_pad('',strlen(trim($badword)),'*'));
}