The curl result is an object, not an array
authorMichael <heluecht@pirati.ca>
Sat, 22 Dec 2018 17:00:28 +0000 (17:00 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 22 Dec 2018 17:00:28 +0000 (17:00 +0000)
mod/ostatus_subscribe.php
src/Network/Probe.php
src/Protocol/PortableContact.php

index 5670820..5d493db 100644 (file)
@@ -77,8 +77,8 @@ function ostatus_subscribe_content(App $a)
 
        $o .= '<p>' . $counter . '/' . $total . ': ' . $url;
 
-       $curlResult = Probe::uri($url);
-       if ($curlResult['network'] == Protocol::OSTATUS) {
+       $probed = Probe::uri($url);
+       if ($probed['network'] == Protocol::OSTATUS) {
                $result = Contact::createFromProbe($uid, $url, true, Protocol::OSTATUS);
                if ($result['success']) {
                        $o .= ' - ' . L10n::t('success');
index f4e3d1d..b4e297a 100644 (file)
@@ -1317,7 +1317,7 @@ class Probe
                                                if ($curlResult->isTimeout()) {
                                                        return false;
                                                }
-                                               $pubkey = $curlResult['body'];
+                                               $pubkey = $curlResult->getBody();
                                        }
 
                                        $key = explode(".", $pubkey);
index de49a8d..cd85c1c 100644 (file)
@@ -1778,7 +1778,7 @@ class PortableContact
                                $curlResult = Network::curl($url);
 
                                if ($curlResult->isSuccess()) {
-                                       $data = json_decode($curlResult["body"], true);
+                                       $data = json_decode($curlResult->getBody(), true);
 
                                        if (!empty($data)) {
                                                self::discoverServer($data, 3);