+ if ($level == 1) {
+ // Trying if it maybe a diaspora account
+ if (($result['network'] == NETWORK_FEED) OR ($result['addr'] == "")) {
+ require_once('include/bbcode.php');
+ $address = GetProfileUsername($url, "", true);
+ $result2 = probe_url($address, $mode, ++$level);
+ if ($result2['network'] != "")
+ $result = $result2;
+ }
+
+ // Maybe it's some non standard GNU Social installation (Single user, subfolder or no uri rewrite)
+ if (($result['network'] == NETWORK_FEED) AND ($result['baseurl'] != "") AND ($result['nick'] != "")) {
+ $addr = $result['nick'].'@'.str_replace("http://", "", $result['baseurl']);
+ $result2 = probe_url($addr, $mode, ++$level);
+ if (($result2['network'] != "") AND ($result2['network'] != NETWORK_FEED))
+ $result = $result2;
+ }
+ }
+
+ // Only store into the cache if the value seems to be valid
+ if ($result['network'] != NETWORK_FEED)
+ Cache::set("probe_url:".$mode.":".$url,serialize($result), CACHE_DAY);
+