Improved word censor 🤐 (#1393)

* Improved default word censor

* Updated

* Updated

* Updated

* Update Censor.php

* Update CHANGELOG.md

* Updated
This commit is contained in:
Roman Kelesidis 2024-02-08 23:17:09 +07:00 committed by GitHub
commit d5390132ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 116 additions and 168 deletions

View file

@ -388,17 +388,12 @@ function add_search_words($post_id, $post_message, $topic_title = '', $only_retu
function bbcode2html($text)
{
global $bbcode;
global $bbcode, $wordCensor;
if (!isset($bbcode)) {
$bbcode = new TorrentPier\Legacy\BBCode();
}
$orig_word = [];
$replacement_word = [];
obtain_word_list($orig_word, $replacement_word);
if (count($orig_word)) {
$text = preg_replace($orig_word, $replacement_word, $text);
}
$text = $wordCensor->censorString($text);
return $bbcode->bbcode2html($text);
}