-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
This is a bit messy. The JSON response from Authorize.Net includes a BOM sequence at the start. This is invisible to the human eye, but causes json_decode() to throw a wobbly. It simply cannot decode the JSON with the BOM.
This is suggested in many places to remove the BOM:
preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $json_string);
I would probably be a little more specific by looking at only the first (up to) three characters:
preg_replace('/^[\x00-\x1F\x80-\xFF]{1,3}/', '', $json_string);
There is also a plugin for Guzzle that removes the BOM, but that appears to be for older Guzzle versions. Not sure about the latest.
Anyway, it has not really got anything to do with these messages, because it's not a part of the data, but if we are not aware of it, it will certainly come to bite us when not dealt with at the transport level.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels