// Replace offensive words with the defined replacement word
function censorwords($text) {
global $settings;
if ($settings['bad_words_enabled'] == "1" && $settings['bad_words'] != "") {
$word_list = explode("rn", $settings['bad_words']);
for ($i = 0; $i < count($word_list); $i++) {
if ($word_list[$i] != "")
$text = preg_replace("/".$word_list[$i]."/si", $settings['bad_word_replace'], $text);
}
}
return $text;
}
bad_words_enabled = 1
bad_words = test
bad_word_replace = ***
/**
* Replace offensive words with the defined replacement word.
* The list of offensive words and the replacement word are both defined in the Security Settings.
*
* @param string $text Text that should be censored.
*
* @return string Censored text.
*/
function censorwords($text) {
$settings = fusion_get_settings();
if ($settings['bad_words_enabled'] && !empty($settings['bad_words'])) {
$words = preg_quote(trim($settings['bad_words']), "/");
$words = preg_replace("/s+/", "|", $words);
$text = preg_replace("/".$words."/si", $settings['bad_word_replace'], $text);
}
return $text;
}
// Replace offensive words with the defined replacement word
if ($settings['bad_words_enabled'] == "1" && $settings['bad_words'] != "") {
$word_list = explode("rn", $settings['bad_words']);
for ($i = 0; $i < count($word_list); $i++) {
if ($word_list[$i] != "")
$message = preg_replace("/".$word_list[$i]."/si", $settings['bad_word_replace'], $message);
}
}
return $message;
Category Forum
Settings - 8Labels
None yet
Statistics
0 participants
Notifications
You are not receiving notifications from this thread.
Related Questions