Skip to content

Commit

Permalink
fix remote_calls
Browse files Browse the repository at this point in the history
  • Loading branch information
davydov committed Jun 4, 2019
1 parent 8e78d4a commit b3c703e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions CleanTalk/Base/CleanTalk.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,12 @@ public static function getTemplateAddon() {
$ct_check_value = self::getCheckjsValue();
self::ctSetCookie();
self::ctSFWTest();
self::apbct_remote_call__perform();

// Remote calls
if(isset($_GET['spbc_remote_call_token'], $_GET['spbc_remote_call_action'], $_GET['plugin_name']) && in_array($_GET['plugin_name'], array('antispam','anti-spam', 'apbct'))){
self::apbct_remote_call__perform();
}

$js_template = '<script>
var d = new Date(),
ctTimeMs = new Date().getTime(),
Expand Down Expand Up @@ -502,7 +507,7 @@ static public function apbct_remote_call__perform() {
$remote_action = $_GET['spbc_remote_call_action'];
$auth_key = trim(XenForo_Application::getOptions()->get('cleantalk','apikey'));

if(array_key_exists($remote_action, $remote_calls_config)) {
if(in_array($remote_action, $remote_calls)) {

if(strtolower($_GET['spbc_remote_call_token']) == strtolower(md5($auth_key))){

Expand All @@ -529,6 +534,5 @@ static public function apbct_remote_call__perform() {
}else
die('FAIL '.json_encode(array('error' => 'UNKNOWN_ACTION')));

}

}
}

0 comments on commit b3c703e

Please sign in to comment.