Skip to content

Commit b6b4e2d

Browse files
author
davydovct
committed
Release 4.9.8
2 parents 8100e37 + 086be08 commit b6b4e2d

File tree

5 files changed

+44
-20
lines changed

5 files changed

+44
-20
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Anti-spam plugin for Joomla 2.5-3.X.
22
============
3-
Version 4.9.7
3+
Version 4.9.8
44

55
## Simple antispam test
66

antispambycleantalk.php

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* CleanTalk joomla plugin
55
*
6-
* @version 4.9.7
6+
* @version 4.9.8
77
* @package Cleantalk
88
* @subpackage Joomla
99
* @author CleanTalk (welcome@cleantalk.org)
@@ -25,7 +25,7 @@ class plgSystemAntispambycleantalk extends JPlugin {
2525
/**
2626
* Plugin version string for server
2727
*/
28-
const ENGINE = 'joomla3-497';
28+
const ENGINE = 'joomla3-498';
2929

3030
/**
3131
* Default value for hidden field ct_checkjs
@@ -953,7 +953,7 @@ public function onAfterInitialise(){
953953
$CTconfig = $this->getCTConfig();
954954
$send_result['result']=null;
955955
$send_result['data']=null;
956-
if ($CTconfig['connection_reports']->negative_report !== null)
956+
if ($CTconfig['connection_reports']['negative_report'] !== null)
957957
{
958958
$to = "welcome@cleantalk.org" ;
959959
$subject = "Connection report for ".$_SERVER['HTTP_HOST'];
@@ -963,7 +963,7 @@ public function onAfterInitialise(){
963963
<title></title>
964964
</head>
965965
<body>
966-
<p>From '.date('d M',$CTconfig['connection_reports']->negative_report[0]->date).' to '.date('d M').' has been made '.($CTconfig['connection_reports']->success+$CTconfig['connection_reports']->negative).' calls, where '.$CTconfig['connection_reports']->success.' were success and '.$CTconfig['connection_reports']->negative.' were negative</p>
966+
<p>From '.date('d M',$CTconfig['connection_reports']['negative_report'][0]->date).' to '.date('d M').' has been made '.($CTconfig['connection_reports']['success']+$CTconfig['connection_reports']['negative']).' calls, where '.$CTconfig['connection_reports']['success'].' were success and '.$CTconfig['connection_reports']['negative'].' were negative</p>
967967
<p>Negative report:</p>
968968
<table> <tr>
969969
<td>&nbsp;</td>
@@ -973,7 +973,7 @@ public function onAfterInitialise(){
973973
</tr>
974974
';
975975
}
976-
foreach ($CTconfig['connection_reports']->negative_report as $key=>$report)
976+
foreach ($CTconfig['connection_reports']['negative_report'] as $key=>$report)
977977
{
978978
$message.= "<tr><td>".($key+1).".</td><td>".$report->date."</td><td>".$report->page_url."</td><td>".$report->lib_report."</td></tr>";
979979
}
@@ -1051,7 +1051,7 @@ public function onExtensionAfterUpdate($name, $data){
10511051
public function onExtensionAfterSave($name, $data)
10521052
{
10531053
$id = $this->getId('system','antispambycleantalk');
1054-
if (strpos(JFactory::getUri(), 'com_plugins&layout=edit&extension_id='.$id) !== false)
1054+
if (strpos(JFactory::getUri(), 'extension_id='.$id) !== false)
10551055
{
10561056
$table = JTable::getInstance('extension');
10571057
$table->load($id);
@@ -1198,9 +1198,9 @@ public function onBeforeCompileHead(){
11981198
ct_moderate_ip = "'.$config['moderate_ip'].'",
11991199
ct_user_token="'.$config['user_token'].'",
12001200
ct_service_id="'.$config['service_id'].'",
1201-
ct_connection_reports_success ="'.(isset($config['connection_reports']->success)?$config['connection_reports']->success:0).'",
1202-
ct_connection_reports_negative ="'.(isset($config['connection_reports']->negative)?$config['connection_reports']->negative:0).'",
1203-
ct_connection_reports_negative_report = "'.addslashes(($config['connection_reports']->negative_report !== null)?json_encode($config['connection_reports']->negative_report):'').'",
1201+
ct_connection_reports_success ="'.$config['connection_reports']['success'].'",
1202+
ct_connection_reports_negative ="'.$config['connection_reports']['negative'].'",
1203+
ct_connection_reports_negative_report = "'.addslashes(json_encode($config['connection_reports']['negative_report'])).'",
12041204
ct_notice_review_done ='.(($config['show_notice_review_done'] === 1)?'true':'false').';
12051205
12061206
//Translation
@@ -1858,12 +1858,16 @@ public function onJCommentsCommentBeforeAdd(&$comment) {
18581858
);
18591859
if (!empty($ctResponse) && is_array($ctResponse)) {
18601860
if ($ctResponse['allow'] == 0) {
1861-
JCommentsAJAX::showErrorMessage($ctResponse['comment'], 'comment');
1862-
$comment->published = false;
18631861
if ($config['jcomments_unpublished_nofications'] != '') {
18641862
JComments::sendNotification($comment, true);
18651863
}
1866-
return false;
1864+
if ($ctResponse['stop_queue'] === 1)
1865+
{
1866+
JCommentsAJAX::showErrorMessage($ctResponse['comment'], 'comment');
1867+
return false;
1868+
}
1869+
$comment->published = false;
1870+
18671871
}
18681872
}
18691873
return true;
@@ -2148,9 +2152,9 @@ private function ctSendRequest($method, $params) {
21482152
{
21492153
$result['allow'] = 1;
21502154
$result['errno'] = 0;
2151-
$connection_reports->negative++;
2155+
$connection_reports['negative']++;
21522156
if (isset($result['errstr']))
2153-
$connection_reports->negative_report[] = array('date'=>date("Y-m-d H:i:s"),'page_url'=>$_SERVER['REQUEST_URI'],'lib_report'=>$result['errstr']);
2157+
$connection_reports['negative_report'][] = array('date'=>date("Y-m-d H:i:s"),'page_url'=>$_SERVER['REQUEST_URI'],'lib_report'=>$result['errstr']);
21542158
}
21552159
if(isset($result['errno']) && intval($result['errno']) !== 0 && intval($ct_request->js_on)!=1)
21562160
{
@@ -2159,10 +2163,10 @@ private function ctSendRequest($method, $params) {
21592163
$result['stop_queue'] = 1;
21602164
$result['comment']='Forbidden. Please, enable Javascript.';
21612165
$result['errno'] = 0;
2162-
$connection_reports->negative++;
2166+
$connection_reports['negative']++;
21632167
}
21642168
if (isset($result['errno']) && intval($result['errno']) === 0 && $result['errstr'] == '')
2165-
$connection_reports->success++;
2169+
$connection_reports['success']++;
21662170
$params->set('connection_reports',$connection_reports);
21672171
$table->params = $params->toString();
21682172
$table->store();
@@ -2233,7 +2237,7 @@ private function getCTConfig() {
22332237
$config['show_notice_review_done'] = $jreg->get('show_notice_review_done',0);
22342238
$config['show_notice_review'] = $jreg->get('show_notice_review',0);
22352239
$config['last_checked'] = $jreg->get('last_checked',0);
2236-
$config['connection_reports']= $jreg->get('connection_reports',array('success' => 0, 'negative'=> 0,'negative_report' => null));
2240+
$config['connection_reports']= (array)$jreg->get('connection_reports',array('success' => 0, 'negative'=> 0,'negative_report' => null));
22372241
return $config;
22382242
}
22392243

antispambycleantalk.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<license>GNU/GPLv2</license>
88
<authorEmail>welcome@cleantalk.org</authorEmail>
99
<authorUrl>cleantalk.org</authorUrl>
10-
<version>4.9.7</version>
10+
<version>4.9.8</version>
1111
<description>PLG_CLEANTALK_DESCRIPTION</description>
1212
<files>
1313
<filename plugin="antispambycleantalk">antispambycleantalk.php</filename>

classes/Cleantalk.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ public function get_servers_ip($host) {
516516
return $response;
517517

518518
if (function_exists('dns_get_record')) {
519-
$records = dns_get_record($host, DNS_A);
519+
$records = @dns_get_record($host, DNS_A);
520520

521521
if ($records !== FALSE) {
522522
foreach ($records as $server) {

plugin-updates.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<updates>
3+
<update>
4+
<name>Antispam by CleanTalk</name>
5+
<description>Antispam plugin for Joomla registrations and contacts, for VurtueMart, Rapid Contact, VTEM Contact, JComments 2.3, 3.0.</description>
6+
<element>antispambycleantalk</element>
7+
<type>plugin</type>
8+
<folder>system</folder>
9+
<client_id>0</client_id>
10+
<client>0</client>
11+
<version>4.9.8</version>
12+
<infourl title="Antispam by CleanTalk">https://cleantalk.org/joomla-anti-spam-plugin-without-captcha</infourl>
13+
<downloads>
14+
<downloadurl type="full" format="zip">https://github.com/CleanTalk/joomla25-3x-antispam/archive/master.zip</downloadurl>
15+
</downloads>
16+
<tags>
17+
<tag>stable</tag>
18+
</tags>
19+
<maintainer>CleanTalk</maintainer>
20+
<maintainerurl>https://cleantalk.org</maintainerurl>
21+
<targetplatform name="joomla" version="[23].*"/>
22+
</update>
323
<update>
424
<name>Antispam by CleanTalk</name>
525
<description>Antispam plugin for Joomla registrations and contacts, for VurtueMart, Rapid Contact, VTEM Contact, JComments 2.3, 3.0.</description>

0 commit comments

Comments
 (0)