mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Improved word censor 🤐 (#1393)
* Improved default word censor * Updated * Updated * Updated * Update Censor.php * Update CHANGELOG.md * Updated
This commit is contained in:
parent
800cd714ef
commit
d5390132ec
15 changed files with 116 additions and 168 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue