From 21c3b723ac0b3052627660a87b9cbd87301f4488 Mon Sep 17 00:00:00 2001 From: davydovct Date: Wed, 5 Sep 2018 13:42:11 +0500 Subject: [PATCH] update version use built-in function for root dir --- CleanTalk/Base/CleanTalk.php | 12 ++++++------ CleanTalk/Base/lib/Cleantalk.php | 4 ++-- CleanTalk/Base/lib/CleantalkSFW.php | 6 +++--- CleanTalk/ControllerPublic/CleanTalkMisc.php | 12 ++++++------ CleanTalk/Model/CleanTalk.php | 12 ++++++------ README.md | 2 +- addon-CleanTalk.xml | 2 +- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/CleanTalk/Base/CleanTalk.php b/CleanTalk/Base/CleanTalk.php index 30427eb..c5ad4e7 100644 --- a/CleanTalk/Base/CleanTalk.php +++ b/CleanTalk/Base/CleanTalk.php @@ -1,9 +1,9 @@ getRootDir().'/library/CleanTalk/Base/lib/Cleantalk.php'; +require_once XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/CleantalkHelper.php'; +require_once XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/CleantalkRequest.php'; +require_once XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/CleantalkRequest.php'; +require_once XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/CleantalkSFW.php'; class CleanTalk_Base_CleanTalk { @@ -318,7 +318,7 @@ public static function hookAdminSettings(XenForo_Visitor &$visitor ){ !empty($_POST['options']['cleantalk']['apikey']) ) { - CleantalkHelper::api_method_send_empty_feedback($_POST['options']['cleantalk']['apikey'], 'xenforo-25'); + CleantalkHelper::api_method_send_empty_feedback($_POST['options']['cleantalk']['apikey'], 'xenforo-26'); if (isset($_POST['options']['cleantalk']['enabled_sfw']) && intval($_POST['options']['cleantalk']['enabled_sfw']) == 1) { diff --git a/CleanTalk/Base/lib/Cleantalk.php b/CleanTalk/Base/lib/Cleantalk.php index 690ad62..ec81d63 100644 --- a/CleanTalk/Base/lib/Cleantalk.php +++ b/CleanTalk/Base/lib/Cleantalk.php @@ -1,6 +1,6 @@ getRootDir().'/library/CleanTalk/Base/lib/CleantalkRequest.php'; +require_once XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/CleantalkResponse.php'; /** * Cleantalk Base class diff --git a/CleanTalk/Base/lib/CleantalkSFW.php b/CleanTalk/Base/lib/CleantalkSFW.php index bb85d69..280eb38 100644 --- a/CleanTalk/Base/lib/CleantalkSFW.php +++ b/CleanTalk/Base/lib/CleantalkSFW.php @@ -1,5 +1,5 @@ getRootDir().'/library/CleanTalk/Base/lib/CleantalkHelper.php'; /* * CleanTalk SpamFireWall base class @@ -205,8 +205,8 @@ public function send_logs($ct_key){ public function sfw_die($api_key, $cookie_prefix = '', $cookie_domain = ''){ // File exists? - if(file_exists($_SERVER['DOCUMENT_ROOT'].'/library/CleanTalk/Base/lib/sfw_die_page.html')){ - $sfw_die_page = file_get_contents($_SERVER['DOCUMENT_ROOT'].'/library/CleanTalk/Base/lib/sfw_die_page.html'); + if(file_exists(XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/sfw_die_page.html')){ + $sfw_die_page = file_get_contents(XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/sfw_die_page.html'); }else{ die("IP BLACKLISTED"); } diff --git a/CleanTalk/ControllerPublic/CleanTalkMisc.php b/CleanTalk/ControllerPublic/CleanTalkMisc.php index 26244b6..b23d404 100644 --- a/CleanTalk/ControllerPublic/CleanTalkMisc.php +++ b/CleanTalk/ControllerPublic/CleanTalkMisc.php @@ -1,9 +1,9 @@ getRootDir().'/library/CleanTalk/Base/lib/Cleantalk.php'; +require_once XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/CleantalkHelper.php'; +require_once XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/CleantalkRequest.php'; +require_once XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/CleantalkRequest.php'; +require_once XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/CleantalkSFW.php'; class CleanTalk_ControllerPublic_CleanTalkMisc extends XFCP_CleanTalk_ControllerPublic_CleanTalkMisc { @@ -117,7 +117,7 @@ public function actionContact() { $ct_request = new CleantalkRequest(); $ct_request->auth_key = $ct_authkey; - $ct_request->agent = 'xenforo-25'; + $ct_request->agent = 'xenforo-26'; $ct_request->response_lang = 'en'; $ct_request->js_on = $checkjs; $ct_request->sender_info = $sender_info; diff --git a/CleanTalk/Model/CleanTalk.php b/CleanTalk/Model/CleanTalk.php index 404a77e..2b18854 100644 --- a/CleanTalk/Model/CleanTalk.php +++ b/CleanTalk/Model/CleanTalk.php @@ -1,9 +1,9 @@ getRootDir().'/library/CleanTalk/Base/lib/Cleantalk.php'; +require_once XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/CleantalkHelper.php'; +require_once XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/CleantalkRequest.php'; +require_once XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/CleantalkRequest.php'; +require_once XenForo_Application::getInstance()->getRootDir().'/library/CleanTalk/Base/lib/CleantalkSFW.php'; class CleanTalk_Model_CleanTalk extends XFCP_CleanTalk_Model_CleanTalk { @@ -194,7 +194,7 @@ protected function _checkSpam($spam_check, $options) { $ct_request = new CleantalkRequest(); $ct_request->auth_key = $ct_authkey; - $ct_request->agent = 'xenforo-25'; + $ct_request->agent = 'xenforo-26'; $ct_request->response_lang = 'en'; $ct_request->js_on = $checkjs; $ct_request->sender_info = $sender_info; diff --git a/README.md b/README.md index e0d98a0..e389b20 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # xenforo-antispam Xenforo anti-spam extension. -# Version 2.5 +# Version 2.6 ## How to install diff --git a/addon-CleanTalk.xml b/addon-CleanTalk.xml index 0d258ed..9573066 100644 --- a/addon-CleanTalk.xml +++ b/addon-CleanTalk.xml @@ -1,5 +1,5 @@ - +