Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion lib/CleantalkAntispam.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,14 @@ private function getCleanTalkResponse()
return new CleantalkResponse(null, null, $error);
}

return new CleantalkResponse(@json_decode($response_raw), null);
if (is_array($response_raw)) {
$response = new CleantalkResponse();
$response->error = $response_raw['error'] ?? 'Unexpected HTTP client response';

return $response;
}

return new CleantalkResponse(json_decode($response_raw), null);
}

/**
Expand Down
Loading