Skip to content

Commit a9404f5

Browse files
committed
Fix: Changed name of to
1 parent b480e4d commit a9404f5

File tree

5 files changed

+22
-11
lines changed

5 files changed

+22
-11
lines changed

cleantalk/cleantalk.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
return;
99
}
1010

11-
global $salt;
12-
$apbct_checkjs_val = apbct_checkjs_hash($apikey, $salt);
11+
global $apbct_salt;
12+
$apbct_checkjs_val = apbct_checkjs_hash($apikey, $apbct_salt);
1313
global $apbct_checkjs_val;
1414
global $antispam_activity_status;
1515
if ($spam_firewall == 1) {

cleantalk/inc/admin.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function install( $files, $api_key, $cms, $exclusions ){
7070
function install_config( $modified_files, $api_key, $cms, $exclusions ){
7171

7272
$path_to_config = CLEANTALK_ROOT . 'config.php';
73-
$salt = str_pad(rand(0, getrandmax()), 6, '0').str_pad(rand(0, getrandmax()), 6, '0');
73+
$apbct_salt = str_pad(rand(0, getrandmax()), 6, '0').str_pad(rand(0, getrandmax()), 6, '0');
7474
// Attention. Backwards order because inserting it step by step
7575

7676
$pass = 'NO PASS';
@@ -119,8 +119,8 @@ function install_config( $modified_files, $api_key, $cms, $exclusions ){
119119
);
120120
}
121121

122-
File::inject__variable( $path_to_config, 'salt', $salt );
123-
File::inject__variable( $path_to_config, 'security', hash( 'sha256', '0(o_O)0' . $salt ) );
122+
File::inject__variable( $path_to_config, 'salt', $apbct_salt );
123+
File::inject__variable( $path_to_config, 'security', hash( 'sha256', '0(o_O)0' . $apbct_salt ) );
124124
File::inject__variable( $path_to_config, 'modified_files', $modified_files, true );
125125
if( $exclusions )
126126
File::inject__variable( $path_to_config, 'exclusions', $exclusions, true );
@@ -243,12 +243,12 @@ function apbct__plugin_update_message() {
243243
* Print Block with CSCart Js Snippet
244244
*/
245245
function apbct__cscart_js_snippet() {
246-
global $apikey, $salt, $detected_cms;
246+
global $apikey, $apbct_salt, $detected_cms;
247247

248248
// Only for CsCart
249249
if ($detected_cms != 'cscart') return;
250250

251-
$apbct_checkjs_hash = apbct_checkjs_hash($apikey, $salt);
251+
$apbct_checkjs_hash = apbct_checkjs_hash($apikey, $apbct_salt);
252252
?>
253253

254254
<div class="highlight">

cleantalk/inc/functions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,10 @@ function apbct_obfuscate_param($value = null)
446446
* return null|0|1;
447447
*/
448448
function apbct_js_test(){
449-
global $apikey, $salt, $detected_cms;
449+
global $apikey, $apbct_salt, $detected_cms;
450450
if(isset($_COOKIE['apbct_checkjs'])){
451451
if(
452-
$_COOKIE['apbct_checkjs'] == apbct_checkjs_hash($apikey, $salt) ||
452+
$_COOKIE['apbct_checkjs'] == apbct_checkjs_hash($apikey, $apbct_salt) ||
453453
($detected_cms === 'cscart' && $_COOKIE['apbct_checkjs'] == md5($apikey))
454454
)
455455
return 1;

cleantalk/lib/Cleantalk/ApbctUni/SFW.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ public function logs__update($ip, $result) {
7979
if($ip === NULL || $result === NULL)
8080
return;
8181

82-
global $salt;
82+
global $apbct_salt;
8383

8484
$time = time();
85-
$log_path = CLEANTALK_ROOT . 'data/sfw_logs/'. hash('sha256', $ip . $salt) .'.log';
85+
$log_path = CLEANTALK_ROOT . 'data/sfw_logs/'. hash('sha256', $ip . $apbct_salt) .'.log';
8686

8787
if( file_exists( $log_path ) ){
8888

cleantalk/lib/Cleantalk/Updater/Updater.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,4 +308,15 @@ private function rollback(){
308308
}else
309309
return false;
310310
}
311+
312+
/**
313+
* Update 2.5.3
314+
*/
315+
function update_to_2_5_3()
316+
{
317+
global $apikey, $apbct_salt;
318+
319+
File::clean__variable(CLEANTALK_CONFIG_FILE, 'apbct_salt');
320+
File::inject__variable(CLEANTALK_CONFIG_FILE, 'apbct_salt', apbct_checkjs_hash($apikey, $apbct_salt));
321+
}
311322
}

0 commit comments

Comments
 (0)