aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Dag <me@dvikan.no> 2024-01-29 21:51:23 +0100
committerGravatar GitHub <noreply@github.com> 2024-01-29 21:51:23 +0100
commitb2c8475b2c789de8c70aab5ea7b5b0ae56a2a507 (patch)
tree4064ce6cb0a3a0329ffa6a54b268fb32101a339d
parentc4fceab7b3de0b842145fa26acbe6f8785474cfd (diff)
downloadrss-bridge-b2c8475b2c789de8c70aab5ea7b5b0ae56a2a507.tar.gz
rss-bridge-b2c8475b2c789de8c70aab5ea7b5b0ae56a2a507.tar.zst
rss-bridge-b2c8475b2c789de8c70aab5ea7b5b0ae56a2a507.zip
fix(gates): json decoding (#3937)
-rw-r--r--bridges/GatesNotesBridge.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/bridges/GatesNotesBridge.php b/bridges/GatesNotesBridge.php
index 0d919968..3381e096 100644
--- a/bridges/GatesNotesBridge.php
+++ b/bridges/GatesNotesBridge.php
@@ -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)) {