mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
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:
parent
3327310064
commit
afaf622902
@ -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.
|
||||
|
@ -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>',
|
||||
|
@ -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> </td>
|
||||
<td><?php echo $txt->badwordsconfig; ?></td>
|
||||
<td align="center"><?php echo $txt->badwordsconfig; ?><br />
|
||||
<i><?php echo $txt->badwordsdefault; ?></i></td>
|
||||
</tr>
|
||||
<table>
|
||||
|
Loading…
x
Reference in New Issue
Block a user