Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/CleantalkAntispam.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

class CleantalkAntispam
{
const VERSION = '4.4';
const MODERATE_URL = 'https://moderate.cleantalk.org/api2.0';
const BOT_DETECTOR_LIBRARY_URL = 'https://fd.cleantalk.org/ct-bot-detector-wrapper.js';
const EVENT_TOKEN_FIELD_NAME = 'ct_bot_detector_event_token';
Expand Down Expand Up @@ -134,8 +135,9 @@ private function setEmailAutomatically()
public static function getFrontendHTMLCode($warn_if_js_disabled = false)
{
$warn = $warn_if_js_disabled ? '<noscript><div>Please, enable JavaScript in the browser to process the form</div></noscript>' : '';
$url = static::BOT_DETECTOR_LIBRARY_URL . '?version=' . self::VERSION;
$html = '<script src="%s"></script>%s';
return sprintf($html, static::BOT_DETECTOR_LIBRARY_URL, $warn);
return sprintf($html, $url, $warn);
}

/**
Expand Down
Loading