From b1c52326e4a56e7313ca25dadac4384298f3863d Mon Sep 17 00:00:00 2001 From: Rick Hoover Date: Fri, 4 Feb 2022 10:10:55 -0500 Subject: [PATCH] removing some cruft --- AkismetPlugin.inc.php | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/AkismetPlugin.inc.php b/AkismetPlugin.inc.php index 6d47973..eea1655 100644 --- a/AkismetPlugin.inc.php +++ b/AkismetPlugin.inc.php @@ -413,26 +413,11 @@ function _sendPayload($data, $flag = false) { return false; } // build the Akismet HTTP request - $requestBody = ''; - foreach ($data as $k => $v) { - if (!empty($v)) { - $requestBody .= '&'.$k.'='.urlencode($v); - } - } - $requestBody = ltrim($requestBody, '&'); $host = $akismetKey.'.rest.akismet.com'; - $port = 443; $path = '/1.1/' . ($flag ? 'submit-spam' : 'comment-check'); $versionDao =& DAORegistry::getDAO('VersionDAO'); $dbVersion =& $versionDao->getCurrentVersion(); $ua = $dbVersion->getProduct().' '.$dbVersion->getVersionString().' | Akismet/3.1.7'; - $httpRequest = "POST {$path} HTTP/1.0\r\n"; - $httpRequest .= "Host: {$host}\r\n"; - $httpRequest .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $httpRequest .= "Content-Length: ".strlen($requestBody)."\r\n"; - $httpRequest .= "User-Agent: {$ua}\r\n"; - $httpRequest .= "\r\n{$requestBody}"; - $response = $errno = $errstr = $headers = $content = ''; $httpClient = Application::get()->getHttpClient(); try {$response = $httpClient->request( 'POST', @@ -448,9 +433,6 @@ function _sendPayload($data, $flag = false) { $content=''; error_log($e->getMessage()); } - - - return ((!$flag && $content === 'true') || ($flag && $content === 'Thanks for making the web a better place.')); }