Skip to content

Commit 12c2886

Browse files
committed
Fixed service sign removing from comments.
1 parent 79d1a64 commit 12c2886

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

antispambycleantalk.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* CleanTalk joomla plugin
55
*
6-
* @version 2.3
6+
* @version 2.4
77
* @package Cleantalk
88
* @subpackage Joomla
99
* @author CleanTalk (welcome@cleantalk.ru)
@@ -21,7 +21,7 @@ class plgSystemAntispambycleantalk extends JPlugin {
2121
/**
2222
* Plugin version string for server
2323
*/
24-
const ENGINE = 'joomla-23';
24+
const ENGINE = 'joomla-24';
2525

2626
/**
2727
* Default value for hidden field ct_checkjs
@@ -753,7 +753,14 @@ function onJCommentsCommentBeforeAdd(&$comment) {
753753
* @since 1.5
754754
*/
755755
function onJCommentsCommentBeforePublish(&$comment) {
756-
self::moderateMessage($comment->comment, 1);
756+
if ($comment->published == 0) {
757+
$comment_comment = $comment->comment;
758+
self::moderateMessage($comment->comment, 1);
759+
760+
if ($comment_comment != $comment->comment) {
761+
$comment->store();
762+
}
763+
}
757764
return true;
758765
}
759766

cleantalk.class.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Cleantalk base class
44
*
5-
* @version 1.30
5+
* @version 1.31
66
* @package Cleantalk
77
* @subpackage Base
88
* @author Сleantalk team (welcome@cleantalk.org)
@@ -597,7 +597,16 @@ private function createMsg($method, CleantalkRequest $request) {
597597
}
598598

599599
$request->method_name = $method;
600-
600+
601+
//
602+
// Removing non UTF8 characters from request, because non UTF8 or malformed characters break json_encode().
603+
//
604+
foreach ($request as $param => $value) {
605+
if (!preg_match('//u', $value)) {
606+
$request->{$param} = 'Nulled. Not UTF8 encoded or malformed.';
607+
}
608+
}
609+
601610
return $request;
602611
}
603612

0 commit comments

Comments
 (0)