diff --git a/.gitignore b/.gitignore index 49e80b6e..c733b071 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ internal_data/log/ internal_data/sitemap/*.xml internal_data/triggers/ library/config.local.php +spam_filter_words.txt ### Archives ### *.log @@ -33,4 +34,4 @@ $RECYCLE.BIN/ .Spotlight-V100 .Trashes *.orig -*.rej \ No newline at end of file +*.rej diff --git a/CHANGELOG.md b/CHANGELOG.md index 749a6d57..82f30b71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ - Added missing translation in admin_ug_auth [\#254](https://github.com/torrentpier/torrentpier-lts/pull/254) ([belomaxorka](https://github.com/belomaxorka)) - Support for IDN domains [\#252](https://github.com/torrentpier/torrentpier-lts/pull/252) ([belomaxorka](https://github.com/belomaxorka)) - Fixed cache directory auto-creating with SQLite [\#247](https://github.com/torrentpier/torrentpier-lts/pull/247) ([belomaxorka](https://github.com/belomaxorka)) -- Minor improvements [\#245](https://github.com/torrentpier/torrentpier-lts/pull/245), [\#246](https://github.com/torrentpier/torrentpier-lts/pull/246), [\#248](https://github.com/torrentpier/torrentpier-lts/pull/248), [\#249](https://github.com/torrentpier/torrentpier-lts/pull/249), [\#250](https://github.com/torrentpier/torrentpier-lts/pull/250), [\#251](https://github.com/torrentpier/torrentpier-lts/pull/251), [\#253](https://github.com/torrentpier/torrentpier-lts/pull/253), [\#255](https://github.com/torrentpier/torrentpier-lts/pull/255), [\#256](https://github.com/torrentpier/torrentpier-lts/pull/256), [\#257](https://github.com/torrentpier/torrentpier-lts/pull/257), [\#258](https://github.com/torrentpier/torrentpier-lts/pull/258) ([belomaxorka](https://github.com/belomaxorka)) +- Minor improvements [\#245](https://github.com/torrentpier/torrentpier-lts/pull/245), [\#246](https://github.com/torrentpier/torrentpier-lts/pull/246), [\#248](https://github.com/torrentpier/torrentpier-lts/pull/248), [\#249](https://github.com/torrentpier/torrentpier-lts/pull/249), [\#250](https://github.com/torrentpier/torrentpier-lts/pull/250), [\#251](https://github.com/torrentpier/torrentpier-lts/pull/251), [\#253](https://github.com/torrentpier/torrentpier-lts/pull/253), [\#255](https://github.com/torrentpier/torrentpier-lts/pull/255), [\#256](https://github.com/torrentpier/torrentpier-lts/pull/256), [\#257](https://github.com/torrentpier/torrentpier-lts/pull/257), [\#258](https://github.com/torrentpier/torrentpier-lts/pull/258), [\#259](https://github.com/torrentpier/torrentpier-lts/pull/259) ([belomaxorka](https://github.com/belomaxorka)) ## [v2.1.5-2023.08-HotFix](https://github.com/torrentpier/torrentpier-lts/tree/v2.1.5-2023.08-HotFix) (2023-09-17) [Full Changelog](https://github.com/torrentpier/torrentpier-lts/compare/v2.1.5-2023.08...v2.1.5-2023.08-HotFix) diff --git a/library/config.php b/library/config.php index c4980c24..f1557983 100644 --- a/library/config.php +++ b/library/config.php @@ -425,7 +425,10 @@ $bb_cfg['max_search_words_per_post'] = 200; // максимальное $bb_cfg['search_min_word_len'] = 3; // минимальное число слов для поиска $bb_cfg['search_max_word_len'] = 35; // максимальное число слов для поиска $bb_cfg['limit_max_search_results'] = false; // ограничить число результатов поиска (указать максимальное число результатов) (false - выключено) -$bb_cfg['spam_filter_file_path'] = ''; // INT_DATA_DIR . 'spam_filter_words.txt'; + +$bb_cfg['spam_filter_file_path'] = false; // спам фильтр (нужно указать путь, например: INT_DATA_DIR . 'spam_filter_words.txt';) (false - выключено) +$bb_cfg['spam_filter_replacement'] = '*СПАМ*'; // слово на которое будет заменен спам + $bb_cfg['autocorrect_wkl'] = true; // autocorrect wrong keyboard layout // Posting diff --git a/library/includes/bbcode.php b/library/includes/bbcode.php index 51e1fcf3..b720ce78 100644 --- a/library/includes/bbcode.php +++ b/library/includes/bbcode.php @@ -621,7 +621,6 @@ class bbcode { global $bb_cfg; static $spam_words = null; - static $spam_replace = ' СПАМ'; if (isset($this)) { @@ -671,7 +670,7 @@ class bbcode } $spam_exp = join('|', $spam_exp); - $text = preg_replace("/($spam_exp)(\S*)/i", $spam_replace, $msg_decoded); + $text = preg_replace("/($spam_exp)(\S*)/i", $bb_cfg['spam_filter_replacement'], $msg_decoded); $text = htmlCHR($text, false, ENT_NOQUOTES); # bb_log(date("H:i:s") ." | ". sprintf('%.4f', (utime() - $tm_start)) ." | ". sprintf('%-6s', strlen($text)) ." | ". join(' ** ', $found_spam) ."\n", 'spam_filter'); } @@ -958,4 +957,4 @@ function get_parsed_post ($postrow, $mode = 'full', $return_chars = 600) function update_post_html ($postrow) { DB()->query("DELETE FROM ". BB_POSTS_HTML ." WHERE post_id = ". (int) $postrow['post_id'] ." LIMIT 1"); -} \ No newline at end of file +}