From bf9760c4a8936936a7cf4c065fd42e1ba9b33b4d Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Tue, 26 Jul 2005 13:05:13 +0000 Subject: [PATCH] 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! --- filter/censor/filter.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/filter/censor/filter.php b/filter/censor/filter.php index 5e29c43574e..23618f5cb4e 100644 --- a/filter/censor/filter.php +++ b/filter/censor/filter.php @@ -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), '', '', false, false,str_pad('',strlen(trim($badword)),'*')); }