From 2910eb2a03462113eafaffa163d15ec953b06034 Mon Sep 17 00:00:00 2001 From: datorik Date: Mon, 18 May 2026 20:16:56 +0300 Subject: [PATCH 1/4] Code. Add get params to bot detector wrapper --- lib/CleantalkAntispam.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CleantalkAntispam.php b/lib/CleantalkAntispam.php index f9568e8..e9c21d5 100644 --- a/lib/CleantalkAntispam.php +++ b/lib/CleantalkAntispam.php @@ -134,8 +134,9 @@ private function setEmailAutomatically() public static function getFrontendHTMLCode($warn_if_js_disabled = false) { $warn = $warn_if_js_disabled ? '' : ''; + $url = static::BOT_DETECTOR_LIBRARY_URL . '?ver=' . gmdate('Ymd'); $html = '%s'; - return sprintf($html, static::BOT_DETECTOR_LIBRARY_URL, $warn); + return sprintf($html, $url, $warn); } /** From 828796fc6fb22b5b5b492c50d32975814311897d Mon Sep 17 00:00:00 2001 From: datorik Date: Fri, 29 May 2026 10:54:22 +0300 Subject: [PATCH 2/4] Code. Add get params to bot detector wrapper --- README.md | 4 ++++ cleantalk-antispam.php | 2 ++ lib/CleantalkAntispam.php | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1eb8c97..5ef6db3 100644 --- a/README.md +++ b/README.md @@ -86,5 +86,9 @@ In [example file](https://github.com/CleanTalk/php-antispam/blob/dev/examples/fo - [example with form handler](https://github.com/CleanTalk/php-antispam/blob/dev/examples/form_with_handler/form_with_handler.php) +## Versioning + +The library version is defined by the `APBCT_VERSION` constant in [`cleantalk-antispam.php`](cleantalk-antispam.php). Bump it manually in every release commit — it is not updated automatically. + ## Don't want to deal with all this? Universal solution for any CMS or custom website: https://github.com/CleanTalk/php-uni diff --git a/cleantalk-antispam.php b/cleantalk-antispam.php index 26928a4..9b3127b 100644 --- a/cleantalk-antispam.php +++ b/cleantalk-antispam.php @@ -1,5 +1,7 @@
Please, enable JavaScript in the browser to process the form
' : ''; - $url = static::BOT_DETECTOR_LIBRARY_URL . '?ver=' . gmdate('Ymd'); + $version = defined('APBCT_VERSION') ? \APBCT_VERSION : '1.0'; + $url = static::BOT_DETECTOR_LIBRARY_URL . '?version=' . $version; $html = '%s'; return sprintf($html, $url, $warn); } From 0ec62554146eca6d2ee3ff477608d89a22dbacc8 Mon Sep 17 00:00:00 2001 From: datorik Date: Mon, 1 Jun 2026 14:27:19 +0300 Subject: [PATCH 3/4] Code. Add get params to bot detector wrapper --- cleantalk-antispam.php | 2 -- lib/CleantalkAntispam.php | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cleantalk-antispam.php b/cleantalk-antispam.php index 9b3127b..26928a4 100644 --- a/cleantalk-antispam.php +++ b/cleantalk-antispam.php @@ -1,7 +1,5 @@
Please, enable JavaScript in the browser to process the form
' : ''; - $version = defined('APBCT_VERSION') ? \APBCT_VERSION : '1.0'; - $url = static::BOT_DETECTOR_LIBRARY_URL . '?version=' . $version; + $url = static::BOT_DETECTOR_LIBRARY_URL . '?version=' . self::VERSION; $html = '%s'; return sprintf($html, $url, $warn); } From 2a08a48e7e3276a0eb4e7366f8df48dd4363b98b Mon Sep 17 00:00:00 2001 From: datorik Date: Mon, 1 Jun 2026 14:30:26 +0300 Subject: [PATCH 4/4] Code. Add get params to bot detector wrapper --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 5ef6db3..1eb8c97 100644 --- a/README.md +++ b/README.md @@ -86,9 +86,5 @@ In [example file](https://github.com/CleanTalk/php-antispam/blob/dev/examples/fo - [example with form handler](https://github.com/CleanTalk/php-antispam/blob/dev/examples/form_with_handler/form_with_handler.php) -## Versioning - -The library version is defined by the `APBCT_VERSION` constant in [`cleantalk-antispam.php`](cleantalk-antispam.php). Bump it manually in every release commit — it is not updated automatically. - ## Don't want to deal with all this? Universal solution for any CMS or custom website: https://github.com/CleanTalk/php-uni