mirror of
https://github.com/kristuff/abuseipdb
synced 2025-08-21 05:53:13 -07:00
fix clean message process
This commit is contained in:
parent
d3828776bb
commit
2e8041d6d1
1 changed files with 6 additions and 7 deletions
|
@ -177,10 +177,11 @@ class ApiManager extends ApiDefintion
|
||||||
$msg = $this->cleanMessage($message);
|
$msg = $this->cleanMessage($message);
|
||||||
|
|
||||||
// report AbuseIPDB request
|
// report AbuseIPDB request
|
||||||
return $this->apiRequest('report', [
|
return $this->apiRequest(
|
||||||
'ip' => $ip,
|
'report', [
|
||||||
'categories' => $cats,
|
'ip' => $ip,
|
||||||
'comment' => $msg
|
'categories' => $cats,
|
||||||
|
'comment' => $msg
|
||||||
],
|
],
|
||||||
'POST', $returnArray
|
'POST', $returnArray
|
||||||
);
|
);
|
||||||
|
@ -305,8 +306,6 @@ class ApiManager extends ApiDefintion
|
||||||
*/
|
*/
|
||||||
protected function apiRequest(string $path, array $data, string $method = 'GET', bool $returnArray = false)
|
protected function apiRequest(string $path, array $data, string $method = 'GET', bool $returnArray = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
// set api url
|
// set api url
|
||||||
$url = $this->aipdbApiEndpoint . $path;
|
$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
|
// If we're reporting spam, further munge any email addresses in the report
|
||||||
$emailPattern = "/[^@\s]*@[^@\s]*\.[^@\s]*/";
|
$emailPattern = "/[^@\s]*@[^@\s]*\.[^@\s]*/";
|
||||||
$emailRemplacement = "[MUNGED]";
|
$emailRemplacement = "[MUNGED]";
|
||||||
preg_replace($emailPattern, $emailRemplacement, $message);
|
$message = preg_replace($emailPattern, $emailRemplacement, $message);
|
||||||
|
|
||||||
return $message;
|
return $message;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue