fix(gates): json decoding (#3937)

This commit is contained in:
Dag 2024-01-29 21:51:23 +01:00 committed by GitHub
parent c4fceab7b3
commit b2c8475b2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,12 +20,9 @@ class GatesNotesBridge extends BridgeAbstract
$apiUrl = self::URI . $api_endpoint . http_build_query($params);
$rawContent = getContents($apiUrl);
$cleanedContent = str_replace([
'<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">',
'</string>',
], '', $rawContent);
// $cleanedContent = str_replace('\"', '"', $cleanedContent);
// $cleanedContent = trim($cleanedContent, '"');
$cleanedContent = trim($rawContent, '"');
$cleanedContent = str_replace('\r\n', "\n", $cleanedContent);
$cleanedContent = stripslashes($cleanedContent);
$json = Json::decode($cleanedContent, false);
if (is_string($json)) {