aboutsummaryrefslogtreecommitdiffhomepage
path: root/Digitigrade/Model/FetchableModel.php
diff options
context:
space:
mode:
Diffstat (limited to 'Digitigrade/Model/FetchableModel.php')
-rw-r--r--Digitigrade/Model/FetchableModel.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/Digitigrade/Model/FetchableModel.php b/Digitigrade/Model/FetchableModel.php
index 1120823..5e4d1e8 100644
--- a/Digitigrade/Model/FetchableModel.php
+++ b/Digitigrade/Model/FetchableModel.php
@@ -55,10 +55,10 @@ abstract class FetchableModel extends Model implements RemoteFetchable {
protected static function fetchFromRemote(string $uri, bool $autoSave): ?static {
// fetch the object
// janky hack: if this is an Instance then avoid recursively fetching itself
- $data = @get_remote_object_authenticated($uri, static::class == Instance::class);
- if ($data === false)
+ $result = @send_request_authenticated($uri, static::class == Instance::class);
+ if (!str_contains($result->headers[0], '200'))
return null;
- $data = json_decode($data);
+ $data = json_decode($result->body);
if ($data === null)
return null;