Skip to content

Commit 263ef72

Browse files
committed
1.1.2
1 parent 2a11664 commit 263ef72

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

CHANGELOG.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,25 @@
22

33
Release notes for the CleanTalk Craft CMS plugin.
44

5-
## 1.1.1 - 2025-06-16
6-
5+
## 1.1.2 - 2025-11-23
76
### Changed
7+
- Fixed compatibility with the `Contact Form Extensions` plugin
8+
- Fixed `Formie` integration Craft 5 field namespace mapping
9+
- Fixed the inability to use env vars for the api key
10+
- Improved `verbb/comments` integration
811

12+
## 1.1.1 - 2025-06-16
13+
### Changed
914
- Fixed possible JavaScript error
1015

1116
## 1.1.0 - 2024-09-25
12-
1317
### Added
14-
1518
- Added `xpertbot/craft-wheelform` (>= v4.0.2) form integration
1619
- Added ability to enable OR disable specific integrations
1720
- Added manual block/allow settings based on email or IP address
1821
- Added bot detector form exclusions
1922

2023
### Changed
21-
2224
- Improved all integration validations
2325
- Improved injected JavaScript
2426
- Numerous code improvements

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cloudgrayau/cleantalk",
33
"description": "CleanTalk Anti-Spam for Craft CMS",
44
"type": "craft-plugin",
5-
"version": "1.1.1",
5+
"version": "1.1.2",
66
"keywords": [
77
"craft",
88
"cms",

src/integrations/CommentsIntegration.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
use cloudgrayau\cleantalk\Cleantalk;
44

55
use Craft;
6-
use craft\events\ModelEvent;
76
use yii\base\Event;
87

98
class CommentsIntegration {
109

1110
public function parse(): void {
12-
Event::on(\verbb\comments\elements\Comment::class, \verbb\comments\elements\Comment::EVENT_BEFORE_SAVE, function(ModelEvent $e){
11+
Event::on(\verbb\comments\elements\Comment::class, \verbb\comments\elements\Comment::EVENT_BEFORE_VALIDATE, function(\yii\base\ModelEvent $e){
1312
$comment = $e->sender;
1413
if ($comment->userId){
1514
$user = Craft::$app->getUser()->getIdentity();
@@ -25,7 +24,7 @@ public function parse(): void {
2524
}
2625
$params['message'] = $comment->getComment();
2726
if (!Cleantalk::$plugin->antiSpam->checkSpam($params)){
28-
$comment->status = \verbb\comments\elements\Comment::STATUS_SPAM;
27+
$comment->addError('comment', 'Comment blocked due to spam.');
2928
}
3029
});
3130
}

src/integrations/ContactFormIntegration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function parse(): void {
1818
if (!Cleantalk::$plugin->antiSpam->checkSpam($params)){
1919
$e->isSpam = true;
2020
}
21-
});
21+
}, append: false);
2222
}
2323

2424
}

src/integrations/FormieIntegration.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ public function parse(): void {
1414
foreach($e->submission->form->getCustomFields() as $field){
1515
switch(get_class($field)){
1616
case 'verbb\formie\fields\formfields\Name':
17+
case 'verbb\formie\fields\Name':
1718
$params['name'] = (string)$e->submission->getFieldValue($field->handle);
1819
break;
1920
case 'verbb\formie\fields\formfields\Email':
21+
case 'verbb\formie\fields\Email':
2022
$params['email'] = (string)$e->submission->getFieldValue($field->handle);
2123
break;
2224
case 'verbb\formie\fields\formfields\Phone':
25+
case 'verbb\formie\fields\Phone':
2326
$params['phone'] = (string)$e->submission->getFieldValue($field->handle);
2427
break;
2528
case 'verbb\formie\fields\formfields\MultiLineText':
29+
case 'verbb\formie\fields\MultiLineText':
2630
$params['message'][] = (string)$e->submission->getFieldValue($field->handle);
2731
break;
2832
}

src/services/AntiSpamService.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Craft;
88
use craft\base\Component;
9+
use craft\helpers\App;
910
use craft\helpers\StringHelper;
1011
use GuzzleHttp\Client;
1112
use GuzzleHttp\Exception\GuzzleException;
@@ -96,7 +97,7 @@ public function checkRegistration(array $params): bool {
9697
private function checkMessage(array $arg): bool {
9798
$params = [
9899
'method_name' => 'check_message',
99-
'auth_key' => Cleantalk::$plugin->settings->apiKey,
100+
'auth_key' => App::parseEnv(Cleantalk::$plugin->settings->apiKey),
100101
'agent' => self::AGENT,
101102
'sender_email' => $arg['email'],
102103
'sender_nickname' => $arg['name'],

0 commit comments

Comments
 (0)