$result = self::diaspora($webfinger);
}
if ((!$result && ($network == "")) || ($network == Protocol::OSTATUS)) {
- $result = self::ostatus($webfinger, false);
+ $result = self::ostatus($webfinger);
}
// if (in_array($network, ['', Protocol::ZOT])) {
// $result = self::zot($webfinger, $result);
$result = self::pumpio($webfinger, $addr);
}
if ((!$result && ($network == "")) || ($network == Protocol::FEED)) {
- $result = self::feed($uri, true);
+ $result = self::feed($uri);
} else {
// We overwrite the detected nick with our try if the previois routines hadn't detected it.
// Additionally it is overwritten when the nickname doesn't make sense (contains spaces).
private static function diaspora($webfinger)
{
$hcard_url = "";
-
$data = [];
// The array is reversed to take into account the order of preference for same-rel links
// Fetch further information from the hcard
$data = self::pollHcard($hcard_url, $data);
+ if (!$data) {
+ return false;
+ }
+
if (!empty($data["url"])
&& !empty($data["guid"])
&& !empty($data["baseurl"])
// We have to overwrite the detected value for "notify" since Hubzilla doesn't send it
$data["notify"] = $data["baseurl"] . "/receive/users/" . $data["guid"];
$data["batch"] = $data["baseurl"] . "/receive/public";
+ } else {
+ return false;
}
return $data;
$curlResult = Network::curl($pubkey);
if ($curlResult->isTimeout()) {
self::$istimeout = true;
- if ($short) {
- return false;
- } else {
- return $data;
- }
+ return false;
}
$pubkey = $curlResult->getBody();
}
&& isset($data["url"])
) {
$data["network"] = Protocol::OSTATUS;
- } elseif ($short) {
- return false;
} else {
- return $data;
+ return false;
}
if ($short) {
$curlResult = Network::curl($data["poll"]);
if ($curlResult->isTimeout()) {
self::$istimeout = true;
- return $data;
+ return false;
}
$feed = $curlResult->getBody();
$dummy1 = null;
$dummy2 = null;
$feed_data = Feed::import($feed, $dummy1, $dummy2, $dummy3, true);
if (!$feed_data) {
- return $data;
+ return false;
}
if (!empty($feed_data["header"]["author-name"])) {