To stop people browsing filters
[moodle.git] / filter / censor / filter.php
CommitLineData
3e6525ba 1<?php // $id$
2//////////////////////////////////////////////////////////////
3// Censorship filtering
4//
5// This very simple example of a Text Filter will parse
6// printed text, replacing words with other words
7//
8// To activate this filter, add a line like this to your
4da85078 9// list of filters in your Filter configuration:
3e6525ba 10//
4da85078 11// filter/censor/filter.php
3e6525ba 12//
13//////////////////////////////////////////////////////////////
14
3e6525ba 15/// This is the filtering function itself. It accepts the
16/// courseid and the text to be filtered (in HTML form).
17
18function censor_filter($courseid, $text) {
19
20 static $search = array('fuck', 'cunt', 'shit', 'wank', 'cock');
21 static $replace = array('f***', 'c***', 's***', 'w***', 'c***');
22
23 return str_ireplace($search, $replace, $text);
24}
25
26
27?>