If no custom list is specified, the default list from the language pack

will be used instead. It works out-of-the-box (again!).
This commit is contained in:
thepurpleblob 2005-08-26 08:33:59 +00:00
parent 3327310064
commit afaf622902
3 changed files with 15 additions and 2 deletions

View File

@ -10,3 +10,8 @@ with other words.
To customise the word list, use the censor settings page
in the filters administration page.
If no customised list has been provided, a default list
specified in the current language pack will be used. Note that
the custom list is an alternative to the default list not
an addition to it.

View File

@ -23,7 +23,13 @@ function censor_filter($courseid, $text) {
if (empty($words)) {
$words = array();
$badwords = explode(',', $CFG->filter_censor_badwords );
// if no user-specified words, use default list from language pack
if (empty($CFG->filter_censor_badwords)) {
$badwords = explode(',',get_string('badwords','censor') );
}
else {
$badwords = explode(',', $CFG->filter_censor_badwords );
}
foreach ($badwords as $badword) {
$badword = trim($badword);
$words[] = new filterobject($badword, '<span class="censoredtext" title="'.$badword.'">', '</span>',

View File

@ -8,6 +8,7 @@
$txt = new Object;
$txt->badwordslist = get_string( 'badwordslist','admin' );
$txt->badwordsconfig = get_string( 'badwordsconfig','admin' );
$txt->badwordsdefault = get_string( 'badwordsdefault','admin' );
?>
<table cellpadding="9" cellspacing="0">
@ -17,6 +18,7 @@
</tr>
<tr>
<td>&nbsp;</td>
<td><?php echo $txt->badwordsconfig; ?></td>
<td align="center"><?php echo $txt->badwordsconfig; ?><br />
<i><?php echo $txt->badwordsdefault; ?></i></td>
</tr>
<table>