Fixed various bugs, improved and refactored some stuff

(remote avatars are working)
This commit is contained in:
Diogo Cordeiro
2018-08-02 18:02:28 +01:00
parent cfc4eece38
commit aa491271f7
15 changed files with 109 additions and 116 deletions

View File

@@ -318,11 +318,9 @@ class Activitypub_profile extends Managed_DataObject
*/
public static function fromUri($url)
{
$explorer = new Activitypub_explorer();
$profiles_found = $explorer->lookup($url);
if (!empty($profiles_found)) {
return self::from_profile($profiles_found[0]);
} else {
try {
return self::from_profile(Activitypub_explorer::get_profile_from_url($url));
} catch (Exception $e) {
throw new Exception('No valid ActivityPub profile found for given URI.');
}
}