Skip to content

Commit 2fce382

Browse files
author
davydovct
committed
fixes for js_keys
1 parent ea0dc46 commit 2fce382

File tree

4 files changed

+29
-9
lines changed

4 files changed

+29
-9
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 5.6
3+
Version 5.6.1
44

55
## Simple antispam test
66

antispambycleantalk.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* CleanTalk joomla plugin
55
*
6-
* @version 5.5
6+
* @version 5.6.1
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-56';
28+
const ENGINE = 'joomla3-561';
2929

3030
/**
3131
* Default value for hidden field ct_checkjs
@@ -107,14 +107,14 @@ private function cleantalk_get_checkjs_code()
107107
$key = strval(md5($config['apikey'] . time()));
108108
$latest_key_time = 0;
109109
if (empty($keys))
110-
$keys = array( $key => time());
110+
$keys = array(time() => $key);
111111
else
112112
{
113113
$keys = json_decode($keys,true);
114-
foreach ($keys as $k => $t) {
114+
foreach ($keys as $t => $k) {
115115
// Removing key if it's to old
116116
if (time() - $t > $config['js_keys_store_days'] * 86400) {
117-
unset($keys[$k]);
117+
unset($keys[$t]);
118118
continue;
119119
}
120120
if ($t > $latest_key_time) {
@@ -124,7 +124,7 @@ private function cleantalk_get_checkjs_code()
124124
}
125125
// Get new key if the latest key is too old
126126
if (time() - $latest_key_time > $config['js_key_lifetime']) {
127-
$keys[$key] = time();
127+
$keys[time()] = $key;
128128
}
129129
}
130130
$id=$this->getId();

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>5.6</version>
10+
<version>5.6.1</version>
1111
<description>PLG_CLEANTALK_DESCRIPTION</description>
1212
<files>
1313
<filename plugin="antispambycleantalk">antispambycleantalk.php</filename>

plugin-updates.xml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<updates>
2+
<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>5.6.1</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/5.6.1.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)