Skip to content

Commit

Permalink
Wrong domain to post data to stopforumspam (#5948)
Browse files Browse the repository at this point in the history
  • Loading branch information
xillibit authored and 810 committed May 25, 2018
1 parent e893141 commit a499605
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/com_kunena/controllers/user.php
Expand Up @@ -1342,9 +1342,9 @@ protected function report($userid)
// Create a 'stream' transport.
$http = new \Joomla\CMS\Http\Http($options, $transport);

$data = "username=" . $spammer->username . "&ip_addr=" . $ip . "&email=" . $spammer->email . "&api_key=" . $this->config->stopforumspam_key;
$data = "username[]=" . $spammer->username . "&ip[]=" . $ip . "&email[]=" . $spammer->email . "&api_key[]=" . $this->config->stopforumspam_key;

$response = $http->put('http://api.stopforumspam.org/api', $data);
$response = $http->post('https://api.stopforumspam.com/api', $data);

if ($response->code == '200')
{
Expand All @@ -1357,7 +1357,7 @@ protected function report($userid)
{
// Report failed or refused
$reasons = array();
preg_match('/<p>.*<\/p>/', $response, $reasons);
preg_match('/<p>.*<\/p>/', $response->body, $reasons);

// Stopforumspam returns only one reason, which is reasons[0], but we need to strip out the html tags before using it
$this->app->enqueueMessage(JText::sprintf('COM_KUNENA_STOPFORUMSPAM_REPORT_FAILED', strip_tags($reasons[0])), 'error');
Expand Down

0 comments on commit a499605

Please sign in to comment.