diff --git a/CHANGELOG b/CHANGELOG index 196e446..e391d4a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +Version 2.20 April 16, 2018 +------------------------------ +- Bug fixes and other minor improvements + Version 2.20 December 24, 2017 ------------------------------ - New option for email notifications diff --git a/README.md b/README.md index 8801125..6a66a29 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # SMF Antispam mod -* **Version:** 2.20 +* **Version:** 2.21 * **License:** GNU General Public License * **Compatible with:** SMF 2.0 and up * **Languages:** English, Russian diff --git a/RoboFile.php b/RoboFile.php index 797cc41..8cfff6b 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -8,7 +8,7 @@ class RoboFile extends \Robo\Tasks { const PACKAGE = 'antispam_cleantalk_smf'; - const VERSION = '2.20'; + const VERSION = '2.21'; const SMF_VERSION = '2.0.14'; // for forumPrepare diff --git a/cleantalkMod.php b/cleantalkMod.php index fee6b47..cc4d81c 100644 --- a/cleantalkMod.php +++ b/cleantalkMod.php @@ -68,7 +68,7 @@ function cleantalk_sfw_check() } } } - if (!empty($modSettings['cleantalk_ccf_checking']) && strpos($_SERVER['REQUEST_URI'], 'action=admin') === false && strpos($_SERVER['REQUEST_URI'], 'action=register') === false && strpos($_SERVER['REQUEST_URI'], 'action=login') === false && strpos($_SERVER['REQUEST_URI'], 'action=post') === false && strpos($_SERVER['REQUEST_URI'], 'action=tpadmin') === false && $_SERVER['REQUEST_METHOD'] == 'POST') + if (!empty($modSettings['cleantalk_ccf_checking']) && strpos($_SERVER['REQUEST_URI'], 'action=admin') === false && strpos($_SERVER['REQUEST_URI'], 'action=register') === false && strpos($_SERVER['REQUEST_URI'], 'action=login') === false && strpos($_SERVER['REQUEST_URI'], 'action=post') === false && $_SERVER['REQUEST_METHOD'] == 'POST') { $ct_temp_msg_data = cleantalkGetFields($_POST); $sender_email = ($ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : ''); @@ -795,14 +795,35 @@ function ctKeyStopStopListening(){ } '; } - +/** + * Calling by hook integrate_exit + */ +function cleantalk_exit() +{ + global $context, $user_info; + if ( + isset($context['template_layers']) && + is_array($context['template_layers']) && + in_array('body', $context['template_layers']) && + ($user_info['is_guest'] || $user_info['posts'] == 0) + ) { + cleantalk_store_form_start_time(); + } +} +/** + * Store form start time + */ +function cleantalk_store_form_start_time() +{ + $_SESSION['ct_form_start_time'] = time(); +} /** * Get form submit time * @return int|null */ function cleantalk_get_form_submit_time() { - return isset($_COOKIE['apbct_timestamp']) ? time() - intval($_COOKIE['apbct_timestamp']) : 0; + return isset($_SESSION['ct_form_start_time']) ? time() - $_SESSION['ct_form_start_time'] : null; } /** diff --git a/install.php b/install.php index 8aff0d0..d4c05f1 100644 --- a/install.php +++ b/install.php @@ -17,6 +17,7 @@ 'integrate_register' => 'cleantalk_check_register', 'integrate_general_mod_settings' => 'cleantalk_general_mod_settings', 'integrate_load_theme' => 'cleantalk_load', + 'integrate_exit' => 'cleantalk_exit', 'integrate_buffer' => 'cleantalk_buffer', ); diff --git a/modification.xml b/modification.xml index a650dfd..04ed43d 100644 --- a/modification.xml +++ b/modification.xml @@ -2,7 +2,7 @@ cleantalk:antispam - 2.20 + 2.21 diff --git a/package-info.xml b/package-info.xml index 985fbee..d8a4662 100644 --- a/package-info.xml +++ b/package-info.xml @@ -4,7 +4,7 @@ cleantalk:antispam Anti-spam by CleanTalk modification - 2.20 + 2.21 readme.txt readme_russian.txt @@ -44,7 +44,7 @@ - This upgrade for Antispam by Cleantalk to 2.20 version: + This upgrade for Antispam by Cleantalk to 2.21 version: - Fix SFW update on save settings - Change SFW template - Remove plugin settings on uninstall @@ -92,7 +92,7 @@ - This upgrade for Antispam by Cleantalk from 2.16 to 2.20 version: + This upgrade for Antispam by Cleantalk from 2.16 to 2.21 version: - Fix create_table for sql_lite - IPv6 support - Update sfw_networks on plugin install @@ -101,7 +101,7 @@ - New option to disable/enable email notifications - Bug fixes and other minor improvements - Обновление Анти-спама от Cleantalk с версии 2.16 до 2.20: + Обновление Анти-спама от Cleantalk с версии 2.16 до 2.21: - Исправлен скрипт создания таблиц для sql_lite - Поддержка IPV6 - Обновление баз SpamFireWall при установке плагина @@ -125,12 +125,12 @@ - This upgrade for Antispam by Cleantalk from 2.17 to 2.20 version: + This upgrade for Antispam by Cleantalk from 2.17 to 2.21 version: - Support Cloudflare CDN - New option to disable/enable email notifications - Bug fixes and other minor improvements - Обновление Анти-спама от Cleantalk с версии 2.17 до 2.20: + Обновление Анти-спама от Cleantalk с версии 2.17 до 2.21: - Поддержка Cloudflare CDN - Добавлена новая опция о включении/отключении e-mail уведомлений - Устранение багов и остальные незначительные улучшения @@ -150,7 +150,7 @@ - This upgrade for Antispam by Cleantalk from 2.18 to 2.20 version: + This upgrade for Antispam by Cleantalk from 2.18 to 2.21 version: - New option to disable/enable email notifications - Bug fixes and other minor improvements @@ -173,11 +173,11 @@ - This upgrade for Antispam by Cleantalk from 2.19 to 2.20 version: + This upgrade for Antispam by Cleantalk from 2.19 to 2.21 version: - New option to disable/enable email notifications - Bug fixes and other minor improvements - Обновление Анти-спама от Cleantalk с версии 2.19 до 2.20: + Обновление Анти-спама от Cleantalk с версии 2.19 до 2.21: - Добавлена новая опция о включении/отключении e-mail уведомлений - Устранение багов и остальные незначительные улучшения @@ -194,5 +194,20 @@ Please stand by while you are being redirected to this mod configuration settings. - + + + This upgrade for Antispam by Cleantalk from 2.20 to 2.21 version: + - Bug fixes and other minor improvements + + Обновление Анти-спама от Cleantalk с версии 2.20 до 2.21: + - Устранение багов и остальные незначительные улучшения + + + Mod main file + modification.xml + install.php + Please stand by while + you are being redirected to this mod configuration settings. + + diff --git a/readme.txt b/readme.txt index b6b7099..451bfea 100644 --- a/readme.txt +++ b/readme.txt @@ -1,5 +1,5 @@ MOD [b]Anti-spam by CleanTalk[/b] -Version: 2.20 +Version: 2.21 Anti-spam by CleanTalk mod with protection against spam bots and manual spam. No Captcha, no questions, no counting animals, no puzzles, no math. diff --git a/readme_russian.txt b/readme_russian.txt index da19ecb..0ed7d87 100644 --- a/readme_russian.txt +++ b/readme_russian.txt @@ -1,5 +1,5 @@ MOD [b]Анти-спам от Cleantalk[/b] -Версия: 2.20 +Версия: 2.21 Анти-спам от Cleantalk с защитой против автоматического и ручного спама. Без капчи, без вопросов, без подсчета животных, без паззлов и т.д diff --git a/upgrades/1.40.xml b/upgrades/1.40.xml index f2f838f..2ebff57 100644 --- a/upgrades/1.40.xml +++ b/upgrades/1.40.xml @@ -6,10 +6,10 @@