Details
Description
Maxmind calls json_encode to encode data prior to sending it to Maxmind for fraud checks. The problem is that json_encode only supports the UTF8 character set. See https://www.php.net/manual/en/function.json-encode
I have not tried to reproduce this, but I suspect that any 4-byte characters like Emoji's that are included in the data being encoded, would cause json_encode to fail.
Here's a partial error:
(MaxMind\\Exception
InvalidInputException(code: 0): Error encoding input as JSON: Malformed UTF-8 characters. at /home/user/blesta/vendors/maxmind/web-service-common/src/WebService/Client.php:107)"}
In a specific use case, the user agent caused the issue, note the special character in the user agent:
[device] => Array
(
[ip_address] => 192.168.0.24
[user_agent] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5 (Ergänzendes Update)) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15
)