fix clean message process

This commit is contained in:
kristuff 2020-06-28 20:34:51 +02:00
commit 2e8041d6d1

View file

@ -177,7 +177,8 @@ class ApiManager extends ApiDefintion
$msg = $this->cleanMessage($message);
// report AbuseIPDB request
return $this->apiRequest('report', [
return $this->apiRequest(
'report', [
'ip' => $ip,
'categories' => $cats,
'comment' => $msg
@ -305,8 +306,6 @@ class ApiManager extends ApiDefintion
*/
protected function apiRequest(string $path, array $data, string $method = 'GET', bool $returnArray = false)
{
// set api url
$url = $this->aipdbApiEndpoint . $path;
@ -363,7 +362,7 @@ class ApiManager extends ApiDefintion
// If we're reporting spam, further munge any email addresses in the report
$emailPattern = "/[^@\s]*@[^@\s]*\.[^@\s]*/";
$emailRemplacement = "[MUNGED]";
preg_replace($emailPattern, $emailRemplacement, $message);
$message = preg_replace($emailPattern, $emailRemplacement, $message);
return $message;
}